
Keyascii in a multiline textbox
Hello,
Quote:
> I have a multiline textbox and I want the user to be
> able to press the "Enter" key to move to a new line
> within the textbox instead of tabbing to the next control.
\\\
Me.KeyPreview = True
.
.
.
Private Sub Form1_KeyDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs _
) Handles MyBase.KeyDown
If e.KeyCode = Keys.Return Then
If TypeOf Me.ActiveControl Is TextBoxBase Then
If DirectCast(Me.ActiveControl, TextBoxBase).Multiline Then
Return
End If
End If
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub
///
Regards,
Herfried K. Wagner