[Gambas-user] Shortcut key issue

Dimitris Anogiatis dosida at gmail.com
Fri Dec 18 22:49:14 CET 2020


It make sense because you're shifting focus from the form object to the
textbox objects. In order to jump from textbox B from textbox A you have to
have the same code in the textbox A's keypress event.

Try this:

After you press Alt-A click on somewhere in the form (in the actual form
not another control) and press Alt-B.
Does it jump to Textbox B now?

On Fri, Dec 18, 2020 at 9:00 AM Benoît Minisini <g4mba5 at gmail.com> wrote:

> Le 18/12/2020 à 16:53, KKing a écrit :
> > So I want a user to be able to jump to certain textboxes using shortcut
> > keys. I can get it to work the first time but subsequent requests appear
> > to be ignored?
> >
> > I've prepared a simple test which has the following
> >
> >> Public Sub Form_KeyPress()
> >>   If Key.Alt Then
> >>     If Key.Code = 65 Then
> >>       TextBox1.SetFocus
> >>     Endif
> >>     If Key.Code = 66 Then
> >>       TextBox2.SetFocus
> >>     Endif
> >>   Endif
> >> End
> >
> > When I Alt+A it jumps to TextBox1 as desired, but if I then Alt+B it
> > doesn't move to TextBox2.
> > If I kill the program and start again and do Alt+B it moves to TextBox2
> > as desired but if I then Alt+A it does nothing.
> >
> > This is on Deb10 with LXDE using G 3.12.2
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> Please post a project.
>
> --
> Benoît Minisini
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201218/1988951f/attachment-0001.htm>


More information about the User mailing list