Hi all
I am making a program whereby when the insert key is pressed in a text
box it opens up another form with the search parameters they entered in
the text box and automatically searches for the data. I have the code
below however it does not work when i press the insert key. I have
tried it with the enter key Ascii code 13 and all works fine! Is it
something to do with Insert being a system/bios key? My code is below;
Private Sub TelephoneTxt_Ke yPress(ByVal sender As Object, ByVal e
As System.Windows. Forms.KeyPressE ventArgs) Handles
TelephoneTxt.Ke yPress
'handle telphone number search
Dim key As Char = Microsoft.Visua lBasic.ChrW(45)
If e.KeyChar = key And TelephoneTxt.Te xt = "" And
SurnameTxt.Text = "" Then
MsgBox("Please enter at least one of the two search
parameters")
ElseIf e.KeyChar = key Then
CustomerSearch. ShowDialog()
CustomerSearch. CustomerReserva tionSearch(Surn ameTxt.Text,
TelephoneTxt.Te xt)
End If
End Sub
Any help is much appreciated
Thanks
James
I am making a program whereby when the insert key is pressed in a text
box it opens up another form with the search parameters they entered in
the text box and automatically searches for the data. I have the code
below however it does not work when i press the insert key. I have
tried it with the enter key Ascii code 13 and all works fine! Is it
something to do with Insert being a system/bios key? My code is below;
Private Sub TelephoneTxt_Ke yPress(ByVal sender As Object, ByVal e
As System.Windows. Forms.KeyPressE ventArgs) Handles
TelephoneTxt.Ke yPress
'handle telphone number search
Dim key As Char = Microsoft.Visua lBasic.ChrW(45)
If e.KeyChar = key And TelephoneTxt.Te xt = "" And
SurnameTxt.Text = "" Then
MsgBox("Please enter at least one of the two search
parameters")
ElseIf e.KeyChar = key Then
CustomerSearch. ShowDialog()
CustomerSearch. CustomerReserva tionSearch(Surn ameTxt.Text,
TelephoneTxt.Te xt)
End If
End Sub
Any help is much appreciated
Thanks
James
Comment