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

F

Fabio Cannizzo

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
 
S

Siva M

Set the text box's SelectionStart property.

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
 
G

gsb58

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top