I am trying to catch the carrage return with this code I found on net but doesn't seem to work. Nothing happens.
Is there another way to do it
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
Wayne
I am trying to catch the carrage return with this code I found on net but doesn't seem to work. Nothing happens.
Is there another way to do it
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
Wayne
Catching carrage return
Kmicic77
John Walker
If e.KeyChar = ControlChars.Cr Then
Yura Developer
A combo box
Private Sub cbbURL_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cbbURL.KeyPress
Sunny9001
Its not a bug, you need to create a derived control and override the Control.IsInputKey method.
protected override bool IsInputKey(Keys keyData)
{
if ((keyData & Keys.KeyCode) == Keys.Enter)
{
return true;
}
return base.IsInputKey(keyData);
}
Protected Overrides Function IsInputKey(ByVal keyData As Keys) As Boolean
If ((keyData And Keys.KeyCode) = Keys.Enter) Then
Return True
End If
Return MyBase.IsInputKey(keyData)
End Function
Once you have done that the KeyPress event should be raised on ENTER.
CPB
Wayne
At times you have to check for Chr (10 ) too .
Shasur
RKN_India
Jin17
BladeWise
Subhash Bhave
I am new to vb net so I don't know anything about derived controls and overiding but am about to find out.
Thanks again,
Vishwanatha Nagur
If e.KeyChar = (vbcrlf) Then