[Gambas-user] Switching between forms in tabstrip

Doriano Blengino doriano.blengino at ...1909...
Wed Feb 25 19:07:18 CET 2009


Vackoy ha scritto:
> @jacky-12
> I understand that but that is not what I need. 
> Let me see if I can explain it better.
> I have a workspace and add several forms to it. In each for i have different
> controls as textboxes, buttons, gridviews, etc.
> The thing is that I want to be able to switch between forms with some key
> combination (i.e. Ctrl + Tab) but the keypress event depends on the control
> that has the focus and not on the tabstrip or the workspace.
> So how can I "get" the keypress regardless the control or object that has
> the focus.
>
> Is there another way of doing this?
>   
I had the same problem some time ago.
The ultimate response is, you can't. To do that, it would be needed a 
"KeyPreview" property of the form, which lets the form intercept all the 
keypresses before they arrive to its controls, perhaps even before they 
reach the Menu.

I managed this situation by using a Menu item, and setting its shortcut. 
In the event handler of that menu, you can do whatever you want. This 
menu should be hidden, but it was reported that hidden Menus don't 
trigger events... but for me it worked (the shortcut was Enter!) - may 
be there are differences from GTK or QT.

Regards,
Doriano





More information about the User mailing list