droopy928gt
03-30-2003, 04:08 AM
Hello All,
Got a problem using Visual Basic 6 and trying to trap the return key in my program.
According to me documentation it should be possible using either the Keydown, Keyup or Keypress event, as long as I make sure none of the command buttons default properlty is set.
Tried this, but it won't work. Only if I type a shifted return, the Keydown, Keyup or Keypress events are triggered. Even stranger is that it is capable of trapping the Esc key, so basically all is allright I'd guess..... I went back to a small test program with 1 form and 1 command button and even there it won't work unless with shifted return.
The reason I need this is that the user of the program must be able using the Tab key to navigate through all command buttons and when a button has focus, by pressing the return key activate its code.
All is basically simple and straight forward code, IF the Keydown, KeyUp or Keypress events were triggered.
Anybody have any idea what I doing wrong :confused: Its probably something stupid and small, but its currently frustrating me a lot.
Thanks for any help offered.
Regards, Leon
PS, If of importance, VB installed here is part of the VS 6 enterprise edition and installed in English using w2k with an English US keyboard.
Got a problem using Visual Basic 6 and trying to trap the return key in my program.
According to me documentation it should be possible using either the Keydown, Keyup or Keypress event, as long as I make sure none of the command buttons default properlty is set.
Tried this, but it won't work. Only if I type a shifted return, the Keydown, Keyup or Keypress events are triggered. Even stranger is that it is capable of trapping the Esc key, so basically all is allright I'd guess..... I went back to a small test program with 1 form and 1 command button and even there it won't work unless with shifted return.
The reason I need this is that the user of the program must be able using the Tab key to navigate through all command buttons and when a button has focus, by pressing the return key activate its code.
All is basically simple and straight forward code, IF the Keydown, KeyUp or Keypress events were triggered.
Anybody have any idea what I doing wrong :confused: Its probably something stupid and small, but its currently frustrating me a lot.
Thanks for any help offered.
Regards, Leon
PS, If of importance, VB installed here is part of the VS 6 enterprise edition and installed in English using w2k with an English US keyboard.