I have a text box that automatically puts a bullet and space (- ) at the beginning of the next line when the user hits enter. It works fine, but now I discovered that if the user inputs many lines of data, then decides to add some data in the middle of all that data and the cursor is placed at the beginning or end of a line and hits enter, the (- ) bullet is put at the bottom of the text box instead of where the cursor is. I want it to be able to insert the bullet (- ) on a new line where the cursor is.
Here's my code:
vb/
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If e.KeyChar = Convert.ToChar(13) Then
e.Handled = True
TextBox7.AppendText(ControlChars.CrLf)
TextBox7.AppendText("- ")
End If
End Sub
/vb
Thanks for any help.
Here's my code:
vb/
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If e.KeyChar = Convert.ToChar(13) Then
e.Handled = True
TextBox7.AppendText(ControlChars.CrLf)
TextBox7.AppendText("- ")
End If
End Sub
/vb
Thanks for any help.