Página 1 de 1
Control Array / Control Names / Control Types
Publicado: Dom Jun 12, 2005 11:47 pm
por Mike Draper
I have a form with a bunch controls on it.
Is there an array of controls that I can go through to, for instance, set
them all to ReadOnly? As I go through this array can I determine the name
and type of each control?
How can I determine the name of the currently active control so I can use
the same event method for a group of controls?
'cVarName' does not seem available in the reference 'oSender:cVarName'
Mike Draper
Control Array / Control Names / Control Types
Publicado: Lun Jun 13, 2005 9:29 am
por ignacio
Mike,
The array you are loking for is oForm:aControls. The determine his type you
can use the property ClassName, but I am afraid the cVarName property is
ONLY available at design time. BTW you can use the 'Cargo' property for your
own needs.
Regards,
"Mike Draper" <
draperm@cogeco.ca> escribió en el mensaje
news:[email=
42acad6c@ozsrvnegro.ozlan.local...]
42acad6c@ozsrvnegro.ozlan.local...[/email]
>I have a form with a bunch controls on it.
>
> Is there an array of controls that I can go through to, for instance, set
> them all to ReadOnly? As I go through this array can I determine the name
> and type of each control?
>
> How can I determine the name of the currently active control so I can use
> the same event method for a group of controls?
>
> 'cVarName' does not seem available in the reference 'oSender:cVarName'
>
> Mike Draper
>
>
Control Array / Control Names / Control Types
Publicado: Lun Jun 13, 2005 7:36 pm
por Mike Draper
So, I would have to add the name of each control to the 'Cargo' to identify
the name of the current (or active) control?
"Ignacio Ortiz de Zúñiga" <
InvalidAccount@ozs.com> wrote in message
news:42ad35bd$[email=
1@ozsrvnegro.ozlan.local...]
1@ozsrvnegro.ozlan.local...[/email]
> Mike,
>
> The array you are loking for is oForm:aControls. The determine his type
> you can use the property ClassName, but I am afraid the cVarName property
> is ONLY available at design time. BTW you can use the 'Cargo' property for
> your own needs.
>
> Regards,
>
>
> "Mike Draper" <
draperm@cogeco.ca> escribió en el mensaje
> news:[email=
42acad6c@ozsrvnegro.ozlan.local...]
42acad6c@ozsrvnegro.ozlan.local...[/email]
>>I have a form with a bunch controls on it.
>>
>> Is there an array of controls that I can go through to, for instance, set
>> them all to ReadOnly? As I go through this array can I determine the
>> name and type of each control?
>>
>> How can I determine the name of the currently active control so I can use
>> the same event method for a group of controls?
>>
>> 'cVarName' does not seem available in the reference 'oSender:cVarName'
>>
>> Mike Draper
>>
>>
>
>
Control Array / Control Names / Control Types
Publicado: Mar Jun 14, 2005 9:37 am
por jfgimenez
Mike,
> So, I would have to add the name of each control to the 'Cargo' to
> identify the name of the current (or active) control?
It's not needed in almost cases. In general, the way to check which is the
oSender is similar to:
METHOD Button1Click( oSender )
IF oSender == ::oButton1
...
ELSEIF oSender == ::oButton2
...
...
ENDIF
RETURN Nil
However, tell us what do you want to do and we could help.
--
Un saludo,
José F. Giménez