I have a textbox that has the property set to mutiple lines. I'd like to diable the "enter" key in the key_press event...any suggestions?
thanks
Printable View
I have a textbox that has the property set to mutiple lines. I'd like to diable the "enter" key in the key_press event...any suggestions?
thanks
In the key press event of the text box do as follows:
dim KeyAscii as integer
KeyAscii = Asc(e.KeyChar)
If KeyAscii = 13 then ' Enter key
e.handled = true
exit sub
end if
doesn't disable the enter key but sure as hell ignores it
alternitvely use the same code but set
e.handled to false in which case you simply get a horrible sounding bleep but the result is the same
all you are doing there is to use the event arguements to control what is going on, using the standard event handler.Yes you could write and add your own event handler but I don't see much point in that on this occassion.
thanks