By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,756 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,756 IT Pros & Developers. It's quick & easy.

TextBox Question

P: n/a
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.

--
*** Ygnacio Durán ***


Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
SelectionStart.

"Ygnacio Durán" <yduranArrobAmixmail.com> wrote in message
news:#2**************@TK2MSFTNGP10.phx.gbl...
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.

--
*** Ygnacio Durán ***

Nov 15 '05 #2

P: n/a
Check out the SelectionStart property.

- Pete
"Ygnacio Durán" <yduranArrobAmixmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.

--
*** Ygnacio Durán ***

Nov 15 '05 #3

P: n/a
On Mon, 2 Feb 2004 17:09:46 -0400, "Ygnacio Durán" <yduranArrobAmixmail.com> wrote:
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

Nov 15 '05 #4

P: n/a
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. :)

"bullshark" <bu*******@scubadiving.com> wrote in message
news:at********************************@4ax.com...
On Mon, 2 Feb 2004 17:09:46 -0400, "Ygnacio Durán" <yduranArrobAmixmail.com> wrote:
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 behindthe "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

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.