[Gambas-user] Iterating through and enabling and disabling controls on a form...

sbungay sbungay at ...981...
Tue Feb 6 15:51:43 CET 2007


   Thanks for the reply Benoit.
   I can live with this, but isn't the Control the child of the Form?
   The way it works now means that the programmer can not default 
controls on a form to Disabled at design time and (eaisly) selectivley 
enable them on Form_Open by iterating through them.
   To achieve the desired functionality everything must be done at run 
time. A routine to initialize the controls to a Disabled State is 
executed on Form_Open, then a second routine iterates through the 
controls and enables those which the user has rights to use.
   Two passes through the controls and two places to make program 
changes = more places to change code as controls are removed or added to 
a form and more places for errors to creep in.


Steve.

Benoit Minisini wrote:
> On Tuesday 06 February 2007 05:15, Stephen Bungay wrote:
> 
>>ControlHandle.Enabled = True doesn't set Enabled to True if the form has
>>Enabled set to False by default. However, if Enabled is set to True by
>>default then ControlHandle.Enabled can successfully toggle the value, thus
>>Disabling and Enabling the control. Is this a bug?
>>
> 
> 
> No, it is a feature. A disabled container automatically disabled its children.
> 
> Regards,
> 




More information about the User mailing list