.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Post New Resource Bookmark and Share   

Set the cursor position at the end of the text in the textbox

Posted By:Asha.MP       Posted Date: November 23, 2010    Points: 50    Category:    URL: http://www.dotnetspark.com  

In this article i will explain how to set the cursor position at the end of the textbox text on click of the button.

This is in the head part of the aspx page.

In the body part of the aspx page        


In the code behind onclick of the button set the focus on the textbox like this

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'Assigning the text box value

Me.TextBox1.Text = "aaaaaaaaaaaaa ssssssssssssss dddddddddddd ffffffffffffffff gggggggggggggggg hhhhhhhhh"

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
'Setting the focus on the textbox

End Sub



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend