I wrote some code to check when the user inputs a new line and then deletes the line. All of that is happening on the TextChanged
event on a Textbox
control and the WordWarp
property set to True
.
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = TextBox1.Text.Replace(vbCr, "")
TextBox1.Text = TextBox1.Text.Replace(vbLf, "")
End Sub
The code kinda works, problem is that when the user inputs a new line on my Textbox
control the text cursor gets sent back to the first character.
Is there any solution to this?