471,348 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

How to get the position of the "typing cursor" in a TextBox?

How can I get/set the position of the typing cursor in a TextBox, expressed
as an integer index, representing the position within the Text string?
Thanks

Regards,
Fabio
Jan 7 '06 #1
3 1519
Set the text box's SelectionStart property.

"Fabio Cannizzo" <fc*****************@london.edu> wrote in message
news:Wr*******************@newsfe2-win.ntli.net...
How can I get/set the position of the typing cursor in a TextBox, expressed
as an integer index, representing the position within the Text string?
Thanks

Regards,
Fabio

Jan 7 '06 #2
Thanks a lot
"Siva M" <sh******@online.excite.com> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Set the text box's SelectionStart property.

"Fabio Cannizzo" <fc*****************@london.edu> wrote in message
news:Wr*******************@newsfe2-win.ntli.net...
How can I get/set the position of the typing cursor in a TextBox,
expressed
as an integer index, representing the position within the Text string?
Thanks

Regards,
Fabio

Jan 8 '06 #3
private void reSkriv_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
try
{
Point mouseDownLocation = new
Point(e.X, e.Y);
if (e.Button == MouseButtons.Left)
{
lblInfo.Text = mouseDownLocation.ToString();
}
....etc

Hope this helps.
Fabio Cannizzo skrev:
How can I get/set the position of the typing cursor in a TextBox, expressed
as an integer index, representing the position within the Text string?
Thanks

Regards,
Fabio


Jan 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Christopher Benson-Manica | last post: by
1 post views Thread by Hans Merkl | last post: by
4 posts views Thread by McKirahan | last post: by
1 post views Thread by Bob Achgill | last post: by
reply views Thread by Matt | last post: by
reply views Thread by =?Utf-8?B?Q29yZXlNY0s=?= | last post: by
26 posts views Thread by Prisoner at War | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.