Determining cursor position in text box in C++ .NET 
Author Message
 Determining cursor position in text box in C++ .NET

Hi,
Is there a way to determine a cursor position (after a mouse click),
that will give me the location (e.g., "after the 233'rd character") in
a text box (rather than the X,Y coordinates)?  This would be
equivalent to the get_SelectionStart function, when one actually
selects part of the text.

Alternatively, is there a function that takes the coordinates and
translates them to a line number and position in the line, based on
font size and other system parameters?

Thanks...



Thu, 20 Jan 2005 03:36:24 GMT  
 Determining cursor position in text box in C++ .NET

Quote:
>Is there a way to determine a cursor position (after a mouse click),
>that will give me the location (e.g., "after the 233'rd character") in
>a text box (rather than the X,Y coordinates)?

For a normal edit control, you can use EM_GETSEL.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Thu, 20 Jan 2005 07:22:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. rich text box cursor position?

2. how to set the position of the text-cursor ?!°

3. setting the position of the text cursor

4. Getting cursor position and text from OE compose window (Internet Explorer_Server)

5. How to put out some text at cursor position in any window

6. Moving the cursor to the last position in an Edit Box

7. Cursor position within an Edit box

8. setting the position of Static text boxes

9. Setting Cursor to the end of the text in EDIT box

10. Wrapping text in text box or edit box

11. ADO.NET (ComboBox, Text Box bindings and so on)

12. How to determine control's position?

 

 
Powered by phpBB® Forum Software