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
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Control Array / Control Names / Control Types
-
- Mensajes: 41
- Registrado: Vie Jul 01, 2005 11:59 pm
- ignacio
- Site Admin
- Mensajes: 9441
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Control Array / Control Names / Control Types
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
>
>
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
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
-
- Mensajes: 41
- Registrado: Vie Jul 01, 2005 11:59 pm
Control Array / Control Names / Control Types
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
>>
>>
>
>
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
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
> 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