Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking text entry cursor position

Status
Not open for further replies.

gmallinson

Programmer
Sep 20, 2004
1
GB
Hi All

I'm trying to track the text cursor position withing a multiline textbox. The only example I can find is for VB6.

Any ideas how this can be done via VB.Net?

Thanks in advance

Gordon
 
You can code within KeyDown event of text box. Get the SelectionStart value of textbox.

Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
Label1.Text = TextBox1.SelectionStart
End Sub

Enjoy.
Jignasu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top