G
Guest
This is the 2nd time posting so sorry for duplications.
I am using VB.NT 2005 & a standard Combobox.
I've been wracking my brain over this problem for a over a month & cannot
seem to find a way to trap the pressing of a Tab Key when the focus is in a
Combobox. The KeyDown or KeyUp event for a combobox will not fire when the
tab key is pressed. The Keyup event will fire when the Tab key is used to tab
into the combo, however I want to trap it while the user intends to leave the
combo. If the user hits the Enter key while in the combo, I've trapped this
just fine & process the data
accordingly. But it's that dang Tab key that eludes me. I've tried to capture
it with the form's keyup/down events and they don't fire either when the tab
is pressed (they work fine when the other keys are pressed though).
So has anyone successfuly trapped a Tab key from within a combo box?
I've considerd other options like the lostfocus & leave events but by simply
leaving the control does not tell me the intent of the user; by hitting
either the enter or tab keys does tell me thier intent & i can process the
entry based on that intent.
The reason is that the user can either select from a list of Purchase Orders
& the grid will be resorted with the PO detail. However the user may enter a
valid PO number that is not already in the system. Generally a user will
either hit the <enter> key or the <tab> key to signify that they have entered
the PO they are looking for. If this PO is not a match to an existing PO I
want to give them the option to enter it at this point.
Thanks
Gary
I am using VB.NT 2005 & a standard Combobox.
I've been wracking my brain over this problem for a over a month & cannot
seem to find a way to trap the pressing of a Tab Key when the focus is in a
Combobox. The KeyDown or KeyUp event for a combobox will not fire when the
tab key is pressed. The Keyup event will fire when the Tab key is used to tab
into the combo, however I want to trap it while the user intends to leave the
combo. If the user hits the Enter key while in the combo, I've trapped this
just fine & process the data
accordingly. But it's that dang Tab key that eludes me. I've tried to capture
it with the form's keyup/down events and they don't fire either when the tab
is pressed (they work fine when the other keys are pressed though).
So has anyone successfuly trapped a Tab key from within a combo box?
I've considerd other options like the lostfocus & leave events but by simply
leaving the control does not tell me the intent of the user; by hitting
either the enter or tab keys does tell me thier intent & i can process the
entry based on that intent.
The reason is that the user can either select from a list of Purchase Orders
& the grid will be resorted with the PO detail. However the user may enter a
valid PO number that is not already in the system. Generally a user will
either hit the <enter> key or the <tab> key to signify that they have entered
the PO they are looking for. If this PO is not a match to an existing PO I
want to give them the option to enter it at this point.
Thanks
Gary