[Gambas-user] Children disable question

Benoit Minisini gambas at ...1...
Sun Oct 5 00:23:17 CEST 2008


On vendredi 03 octobre 2008, Ron wrote:
> Hi,
>
> say I have a Form with alot of frames on it with buttons etc. in them.
>
> I want to enable only 2 frames and the buttons inside them at some point.
> When I first disable all, and then try to enable just the 2 frames, it
> doesn't work, they all stay disabled.
>
> Have I shoot myself in the foot, by using ME.Children, or should it work?
>
>     DIM oObject as Object
>
>     FOR EACH oObject IN ME.Children
>       oObject.Enabled = FALSE
>     NEXT
>     FOR EACH oObject IN frameStream.Children
>       oObject.Enabled = TRUE
>     NEXT
>     FOR EACH oObject IN frameDevice.Children
>       oObject.Enabled = TRUE
>     NEXT
>
> Gambas 2.9 using gb.qt
>
> Regards,
> Ron_2nd.
>

A control is really enabled only if all its ancestor are enabled. Check that!

-- 
Benoit Minisini




More information about the User mailing list