Hi,
I am using a button to insert a string into a textbox on my webform. I want the cursor position to be set to the end of the inserted text so the user can continue typing without having to manually reposition the cursor.
In a VB.NET windows form i'd use...
TextBox1.Text = "Hello World"
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.Length
I can insert the text and focus back onto the textbox, but when the textbox recieves focus the cursor is reset to the start of the text.
Does anyone know how i can set the cursor to the end in ASP.NET?
Thanks
I am using a button to insert a string into a textbox on my webform. I want the cursor position to be set to the end of the inserted text so the user can continue typing without having to manually reposition the cursor.
In a VB.NET windows form i'd use...
TextBox1.Text = "Hello World"
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.Length
I can insert the text and focus back onto the textbox, but when the textbox recieves focus the cursor is reset to the start of the text.
Does anyone know how i can set the cursor to the end in ASP.NET?
Thanks