Thread: getting Textbox cursor position

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    getting Textbox cursor position

    How do I get the position of the cursor in a multiline textbox?

  2. #2
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    I'm pretty sure you can use TextBox.SelectionStart property to get the position of the insertion cursor. If you're talking about the mouse cursor, you can use Control.MousePosition static property.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    ok I got that now I need to get the x and y of the cursor relative to the main window. And yes I ment the textbox cursor not the windows cursor.

    I was thinking of just get the x and y of the textbox curosr than add the x and y of the textboxes upper left cornor. That would make it relative to the main window.
    Last edited by Rune Hunter; 12-10-2005 at 10:53 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2009, 04:40 AM
  2. Replies: 5
    Last Post: 03-02-2009, 08:33 AM
  3. Problem with a multiline textbox
    By Zeokat in forum C# Programming
    Replies: 4
    Last Post: 10-24-2008, 01:14 PM
  4. inserting text in a textbox
    By Rune Hunter in forum C# Programming
    Replies: 1
    Last Post: 01-07-2006, 05:32 PM
  5. How would I add a textbox?
    By -KEN- in forum C# Programming
    Replies: 2
    Last Post: 11-13-2001, 02:02 PM