[Gambas-user] Ask About Focus of object
Doriano Blengino
doriano.blengino at ...1909...
Wed Oct 8 07:19:24 CEST 2008
Leo Sendra ha scritto:
> As we know, we can move a focus to another object by using tab button and down/up arrow button.
> By using enabled property (change the value to false), we can disable a focusing to a object.
> I want to disable focus to a object but I don't want this object has been disabled (enabled = true).
>
> For example, there is an object. This object's enabled property is true. But, I can't use a tab button or down/up arrow button to get focus on it.
> Is it possible? If yes, how can I do it???
>
Sometimes I use the GotFocus event of the object I don't want to get
focused ("public sub ManipulatedControl_GotFocus"). In this event I set
the focus to another control (othercontrol.Setocus). For very simple
situations it does smoothly.
This method is indeed a hack: if you click this "manipulated" control,
it won't get focus; if you tab-travel forward and back, one of the two
directions won't work; so you have to use global variables to keep trace
of the current status, if you want more complete control over the focus.
Cheers,
Doriano
More information about the User
mailing list