473,403 Members | 2,183 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,403 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 1576
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christopher Benson-Manica | last post by:
Why isn't there a value for the cursor property that corresponds to "unavailable" (usually the circle with a hash through it)? -- Christopher Benson-Manica | I *should* know what I'm talking...
1
by: Hans Merkl | last post by:
Hi, I have a very old piece of code which supposedly comes from OS/2. It looks like this: class indexTable:std::multimap<Type1,Type2> { };
4
by: McKirahan | last post by:
This is from a previous post entitled "cursor type": "IE 4.0 through 5.5 didn't support the cursor type 'pointer' (only the non-standard 'hand')." How might the following be modified to...
3
by: Aaron Queenan | last post by:
I have a form which performs some asynchronous code. I want to display a wait cursor when it starts, and hide the wait cursor when it has completed. This part works fairly well, using: ...
1
by: Bob Achgill | last post by:
No this is not a new dance. OK. Am I missing something. The following code captures the cursor keys alright on the form1 for everywhere except when the focus is on a DataGrid or AxWebBrowser....
0
by: Matt | last post by:
Ok, given that this is a windows ocx, it should be pretty easy to do this but I just haven't been able to figure it out. What I have is a datagrid on my form populated with various pieces of...
0
by: =?Utf-8?B?Q29yZXlNY0s=?= | last post by:
I'm working on a TextBox control (in C# using .NET 2.0) that allows fields (like MS Office's mail merge feature). I want the editor to treat the field as though it was a single character. The user...
3
by: geddy | last post by:
My OS: Ubuntu 7.04 distribution Mysql: Server version: 5.0.38-Ubuntu_0ubuntu1.2-log Ubuntu 7.04 distribution mysql-python:1.2.2 python:2.5 when I run the following script: import MySQLdb conn...
26
by: Prisoner at War | last post by:
Hello, Everyone: Is there any other values or whatever-it's-called to the cursor property in CSS?? So far, I only know of cursor:pointer (or, for MSIE, cursor:hand).... Any way to load in...
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.