M
moondaddy
I'm using vb.net/vs2003: In a combobox's keyup event I need to exit the
keyup event procedure if the user was executing (Alt + S) to save the
record, but if the user was simply entering the key (S) then I need to
finish executing the code in this sub.
I envision suto code looking like this:
IF a.Key = Keys.S AND Keys.Alt was pressed while Keys.S was pressed
then exit sub.
I could probably do something like create 2 module level variables
(FLOG_Actresses and FLOG_Key). Then when the use enters (Alt + S) in the
key down event if eke = Keys.Alt then set FLOG_Actresses to true, and the
next time the key event fires; if a.Key = Keys.S AND FLOG_Actresses then
FLOG_Key = true. Now in the keyup even regardless of which order the user
lets up the Alt and S key (Alt first or S first),
If FLOG_Key = true then
FLOG_Alt_Pressed = False
FLOG_Key = False
Exit Sub
End IF
In short, I need to know that if while the S Key was pressed, was the ALT
Key also pressed (at any time - before or during the S key being pressed),
and if so, do something.
In theory I think this would work, but I also need to do the same sort of
trapping for other key combinations such as Alt+UP, Alt+DO, Alt+NO, Alt+CO,
etc. and if my form has a bunch of combo used for data entry, there would be
a lot of extra code. I think this would be messy and un-elegant. is there
a better way to do this?
Thanks.
keyup event procedure if the user was executing (Alt + S) to save the
record, but if the user was simply entering the key (S) then I need to
finish executing the code in this sub.
I envision suto code looking like this:
IF a.Key = Keys.S AND Keys.Alt was pressed while Keys.S was pressed
then exit sub.
I could probably do something like create 2 module level variables
(FLOG_Actresses and FLOG_Key). Then when the use enters (Alt + S) in the
key down event if eke = Keys.Alt then set FLOG_Actresses to true, and the
next time the key event fires; if a.Key = Keys.S AND FLOG_Actresses then
FLOG_Key = true. Now in the keyup even regardless of which order the user
lets up the Alt and S key (Alt first or S first),
If FLOG_Key = true then
FLOG_Alt_Pressed = False
FLOG_Key = False
Exit Sub
End IF
In short, I need to know that if while the S Key was pressed, was the ALT
Key also pressed (at any time - before or during the S key being pressed),
and if so, do something.
In theory I think this would work, but I also need to do the same sort of
trapping for other key combinations such as Alt+UP, Alt+DO, Alt+NO, Alt+CO,
etc. and if my form has a bunch of combo used for data entry, there would be
a lot of extra code. I think this would be messy and un-elegant. is there
a better way to do this?
Thanks.