Results 1 to 4 of 4

Thread: Get the Location of the caret?

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Get the Location of the caret?

    How can I get the location (x,y) of the caret (not the cursor) in a textbox? Any Ideas?

    I am trying to show a "floating" listbox like the intellsense does in a textbox and I can't figure a good way to determine height. I could measure it with the length of the text but if some of the text is not in the visible window then it gets too low.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Have no idea if this will help you out:
    http://www.microbion.co.uk/developer...p/textpos2.htm
    I'll keep looking.

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I think in the User32.lib there is a GetCaretPos API call you can make.

    Try this link:
    http://search.microsoft.com/default....&siteid=us/dev

  4. #4

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well I had seen the article that the first link is an addendum to, but that one is better because it mentions a GetPositionFromCharIndex function in .NET but its only for RichTextBoxes. So I switched it to a RichTextBox and it works good, thanks. The other one was only for Windows CE.

    Thanks a lot I thought this was going to be harder than that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width