you're right, ALT+Z doesn't seem to work with Keypress (ALT+Anyhting doesn't work). Probably because it is needed for access keys or something.
Instead in the gotfocus event...
ON KEY label ALT+Z Messagebox("User Pressed ALT+Z"
...in the lostfocus event...
ON KEY label ALT+Z
...now the messagebox() function above is just to show that it can be done...you will need to replace it with a function that will do your zooming functionality.
Slighthaze = NULL
[ul][li]FAQ184-2483 An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
Any ALT+ combination will not be recognised in KeyPress Events of any control. This is because, the system menus are associated with Alt and also Windows behaviour of pressing Alt takes precedence.
Instead use Ctrl+Z and trap it in the KeyPressEvent.
As a general recommendation: try to avoid using Alt+<letter> keystroke combination for your own purposes. Almost all of these combinations are reserved as shortcut key sequences by OS or VFP itself, i.e. Alt+F, Alt+W, Alt+Z, etc. I found it out the hard way.
I'd suggest using Alt+Shift+<letter> instead, or Ctrl+<letter> (the later also can be dangerous, think of Ctrl+F, Ctrl+C, Ctrl+V, etc.)
ON KEY LABEL Alt+<letter> is one way to bypass system defined key sequence. Just don't forget PUSH KEY before redefining, and POP KEY after you've done with your routine, and most of all - ON KEY LABEL on exiting your program.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.