[Gambas-user] Bugs in gambas 3.16
Benoît Minisini
g4mba5 at gmail.com
Wed Apr 21 18:45:11 CEST 2021
Le 21/04/2021 à 17:56, Safiur Rahman a écrit :
> Hi Benoît
>
> If I use "Next" property to change focus to next control instead of
> using Desktop.SendKeys("\t") then it is fine except when the active
> control is Valuebox.
>
> When Application.ActiveControl is ValueBox then
> Application.ActiveControl.Next is Null. Thats why I am not able to use
> "Next" property to change focus to next control.
>
> Public Sub Form_KeyRelease()
> If Key.Code = Key.Enter Or If Key.Code = Key.Return Then
> Application.ActiveControl.Next.SetFocus
> Endif
> End
>
> Attached a sample project. Just press Return to change Focus from one
> control to other. You will get error
>
It's because it's more complex than that, as soon as you use controls
made in Gambas that actually are containers. There is the notion of
"proxy" controls that are the real controls that get the focus in place
of the control you call SetFocus() on.
I will write GUI methods "FocusNext" / "FocusPrevious" (or something
like that) that handle all the stuff and the corner cases.
Regards,
--
Benoît Minisini
More information about the User
mailing list