TextBox Question

  • Thread starter Thread starter Ygnacio Durán
  • Start date Start date
Y

Ygnacio Durán

Hi there, I'm new in c# and need to know how to get the position of the
cursor in a textbox control.

For example, let be the text : "My text", if the cursor position is behind
the "x", then the position is 5.


Thanks a lot.
 
Hi there, I'm new in c# and need to know how to get the position of the
cursor in a textbox control.

For example, let be the text : "My text", if the cursor position is behind
the "x", then the position is 5.

It sounds like you're off on a bad idea, The position you describe
would be 6 not 5, but see the documentation for TextBox.SelectionStart
property.

regards,

bullshark
 
In his descriptions, he assumed the first character might have been at
position zero rather then one. Who among us have not maid an indexing
mistake. :)

 
Back
Top