hi, environmen is visual basic 6.0
the code is :
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then Unload Me
End Sub
'
Click to View Image78 View(s)
this is a window where do a search for custumers
it's very simple.
has only 5 controls: 2 label. 1 textbox 1 combo box and 1 igrid control.,
load all records into igrid and in text change event do a search with l = cBusca.FindSearchMatchRow(cmbBusca.Text, bString, , True, igSearchMatchStartsWith);
if the user choose close without get any record, he simple press escape. allright. but not when igrid has the focus. but in the igrid the event keydown receiv the keycode escape. but the form not. the for has keypreview set to true.
thanks.