Keyup event with Enter key not working???

yousuf42

Well-known member
Joined
Feb 12, 2006
Messages
101
Programming Experience
1-3
Dear all,

Following code is not working with Enter Key What is wrong here? All other Chr 's working. For Example if I put :



Following is the DG Tablestyles column

VB.NET:
dgtbc = dgInvoice.TableStyles(0).GridColumnStyles(1) '
If Not (dgtbc Is Nothing) Then
 
dgtbc.Width = 110
dgtbc.HeaderText = " Product ID"
dgtbc.TextBox.CharacterCasing = CharacterCasing.Upper
 
AddHandler dgtbc.TextBox.KeyPress, AddressOf CellPress
End If

Handler CellPress This Does Not Work: -

VB.NET:
Private Sub CellPress(ByVal sender As Object, ByVal e As KeyPressEventArgs)  
 
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
MsgBox("Enter Key Pressed")
SendKeys.Send("{TAB}")
End If
End Sub

Below Mentioned code Works :-

VB.NET:
Private Sub Cellkeypress(ByVal sender As Object, ByVal e As KeyPressEventArgs)  
Dim dtcol As DataColumn = dt.Columns(2)
If e.KeyChar = "A"c Then
e.Handled = True
MsgBox("A Pressed")
SendKeys.Send("{TAB}")
End If
 
End Sub

So How can I Use EnterKey in above code. Also I'm unable to Use KeyUp in above with KeyEventArgs

Can any one help me pleeeeeeeeeeease??

Thanks in advance
 
Last edited:
Back
Top