how do i stop a multiline edit box from entering a cf/vbcrlf watever wen i press enter?
Printable View
how do i stop a multiline edit box from entering a cf/vbcrlf watever wen i press enter?
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = IIf(KeyAscii = vbCrLf,0,KeyAscii) End Sub
:)
edit box?
do you mean Textbox?
that gives me a type mismatch m8
Sorry, I keep forgetting that vbCrLf is the actual character(s), not the number :rolleyes:. Try replacing vbCrLf with vbKeyReturn.Quote:
Originally posted by adzzzz
that gives me a type mismatch m8
:)
ThisVB Code:
Private Sub Text1_Change() Text1.Text = Replace(Text1.Text, vbNewLine, "") End Sub
help?
Try
Code:Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then KeyAscii = 0
End Sub