Catching carrage return
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?
Wayne
If e.KeyChar = Microsoft.VisualBasic.ChrW(13)Then
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?
Wayne
If e.KeyChar = Microsoft.VisualBasic.ChrW(13)Then
A combo box
Private Sub cbbURL_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cbbURL.KeyPress
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 MyBase.IsInputKey(keyData) End Function |
Once you have done that the KeyPress event should be raised on ENTER.