Combox respond to Enter Key click event HOW?

vbMarkO

Centurion
Joined
Aug 19, 2005
Messages
157
I have a combox

NOTE; It is a toolStripCombox called tscStubDates

I want to select an item then hit enter and it fire the code I have which will display records from an xml file I have.

Note, I already have it where I use the click event.... but I want to select an item then be able to scroll through using hte arrow keys then when I get to the date of a specific record fire that event by hitting the enter key

How do I do this?

vbMarkO
 
If the item has key events then you can use the following. If it doesn't things will be a little more tricky.
Visual Basic:
' in key down event    
If e.KeyCode = Keys.Return Then
    ' do something
End If
If this isn't possible you could try setting the KeyPreview property of the form to true and using the forms key events, you will just have to try and check if the combobox has focus first. I can't really be much more specific as I'm using 2003 and so don't have a toolstrip control.
 
Back
Top