We have a multi-line control that we are attempting to prevent the Enter/Return key from being used to create a new line.
Strangely enough, "AcceptsReturn" as False does not prevent this.
So we added the following:
Private Sub txtAddr_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAddr.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
e.Handled = True
End If
End Sub
This works fine, however one of the QA people discovered hitting Control + Enter still puts in a newline.
How would we prevent this?
And why does AcceptsReturn being False not work as it appears it should? What is the intended purpose of it?