473,725 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1592
Set the text box's SelectionStart property.

"Fabio Cannizzo" <fc************ *****@london.ed u> wrote in message
news:Wr******** ***********@new sfe2-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******@onlin e.excite.com> wrote in message
news:uL******** ******@tk2msftn gp13.phx.gbl...
Set the text box's SelectionStart property.

"Fabio Cannizzo" <fc************ *****@london.ed u> wrote in message
news:Wr******** ***********@new sfe2-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_MouseDo wn(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
try
{
Point mouseDownLocati on = new
Point(e.X, e.Y);
if (e.Button == MouseButtons.Le ft)
{
lblInfo.Text = mouseDownLocati on.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
4009
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 about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
1
1237
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
2000
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 display correctly in all browsers? <html> <head> <title>cursor.htm</title>
3
4127
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: this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor; I also want to prevent user interaction with the controls on my form while the wait cursor is displayed, so that use events (except resize and cancel) are blocked. What is the...
1
1222
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. Yes i have set the KeyPreview property on the form to true. Almost home!
0
1055
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 information. What I would like is to be able to start typing and have the datagrid move to the thing I'm typing if it exists. For example given the list: Ant
0
1894
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 shouldn't be able to delete part of the field or select only part of the field. For example, a line might look like: «Image» shot on «Date» at «Resolution» where «Image» «Date» «Resolution» are all fields. My control inherits from...
3
4486
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 = MySQLdb.connection('localhost', 'root', '', 'books'); c=conn.cursor() cur = conn.cursor();
26
2536
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 one's own somehow?? Just a noob at this...TIA!!
0
8751
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9171
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9108
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4781
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3218
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2155
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.