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 ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user