|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
surpress newline on Enter presshi, i have a control that inherits from RichTextBox. What i want to be able
to do is surpress the Enter key inserting a newline into the text. For instance, in AIM when you press Enter, it doesnt insert a new line, it sends the message. Thats the kind of thing i want to be able to do. How can i do this? thanks -- -iwdu15 Capture the KeyChar of Enter i.e. 13 and call some other method on
KeyDown event even if i catch the enter keypress, it still goes through...how can i stop it
from going through? -- -iwdu15 iwdu15 wrote:
> hi, i have a control that inherits from RichTextBox. What i want to be able I believe this is what you want (Watch for line-wrapping) -> to do is surpress the Enter key inserting a newline into the text. For > instance, in AIM when you press Enter, it doesnt insert a new line, it sends > the message. Thats the kind of thing i want to be able to do. How can i do > this? > > thanks Private Sub RichTextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox1.KeyDown If e.KeyCode = Keys.Return Then e.SuppressKeyPress = True 'The "Return/Enter Key" is now absorbed 'Now do something else here..... End If End Sub ShaneO There are 10 kinds of people - Those who understand Binary and those who don't.
Unique an array of strings
problems with compacting Directly Passing Variables Publish Version number Adding Help To My Application Simple xpath question How to remove last line in a file *** Using DataReaders to populate combo boxes - please help!!! *** Monitor Software Installation Changes DirectCast Timeout issue HttpWebResponse |
|||||||||||||||||||||||