When the enter key is pressed, I would like to have <br /> added to the end of a each line in multiline textbox then allow me to type next line. Then repeat for each line.
using Code:
Private Sub TextBox_Body_TextChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox_Body.KeyDown If e.KeyCode = Keys.Enter Then TextBox_Body.Text = TextBox_Body.Text + "<br />" End If End Sub
works ok for single line. Does however insert a blank line above current text and cursor is at start of second line containing text.
Make sense?![]()




Reply With Quote