473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

TextBox Question

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
4 11890
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Devinim ŢÖLEN | last post by:
Hi; I try to fetch data and show in the textbox as follows; .. .. .. .. <asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"...
3
by: Henry | last post by:
Hi. I've also posted this at another discussion board and here is the original question. ------------------------- "I have this problem and I don't know what I can do. First of all, I have a...
2
by: Jon | last post by:
Hello All, I have a datalist whose itemtemplate contains a label and a textbox. The label text is set on itemdatabound with the text, which is a question, from the database column. Each question...
0
by: jason | last post by:
Hello everyone. I am trying to write some custom command events into a DataGrid. The command that is currently giving me trouble is an "Add" custom command in the footer of a template column. ...
1
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of...
13
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the...
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
10
by: garyusenet | last post by:
I have a multiline textbox. The size of the text box should be 75 characters wide, and 5 lines in height like this: - <---75 characters--> <---75 characters--> <---75 characters--> <---75...
4
by: Randy | last post by:
My situation is that I have a form on which a number of textboxes and comboboxes are added dynamically based on interaction with the user. As these controls are added, they are given names based on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.