vin
July 17th, 2001, 02:41 AM
Given a dialog with several buttons. Default behavior is when user press arrow keys to move the focus between them (buttons). However I need to override this behavior. I need to change it so that when user press arrow keys to call my function that will do something (moving this window etc). It seems that when I catch the keypress event it catch all keys except arrow keys, enter tab etc. I need to catch arrow keys.
Any idea?
Valery Iskarov Nikolov
http://listen.to/quark
Clearcode
July 17th, 2001, 03:27 AM
You could Subclass the window proc of your dialog and perform this operation when you recieve a WM_KEYDOWN and WM_KEYUP messages.
There are a number of code samples on this technique or you could download the EventVB.OCX from http://www.merrioncomputing.com/Download/index.htm and drop a VBEventWindow control on your form and then set it's ParentWnd member and put your code in it's WindowMessage() event.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.