|
-
Jan 10th, 2001, 04:20 AM
#1
Thread Starter
Lively Member
I would like to know how can I get the cursor position in a RichTextControl using SendMessage API.
In fact, I want to get the column position of the cursor in the current line.
Many thanks,
Thierry
-
Jan 10th, 2001, 03:36 PM
#2
You can use the GetLineFromChar method.
Code:
iLine = RichTextBox1.GetLineFromChar(RichTextBox1.SelStart) + 1
-
Jan 12th, 2001, 05:33 AM
#3
Thread Starter
Lively Member
This is not what I want...
I know how to get the current line.
What I would like to know is the number of characters from the begin of the current line !...
Example :
This is
my text
If the cursor is between the 't' and 'e' letters of 'text' word, I would like to get the position '5'.
Many Thanks,
Thierry
-
Jan 12th, 2001, 07:12 AM
#4
Try this:
Code:
MsgBox Len(Left(Text1.Text, Text1.SelStart))
-
Jan 12th, 2001, 08:17 AM
#5
Thread Starter
Lively Member
Not what I want !...
This give you the position from the beginning of the text.
If my current line is 2, I want to get the position from the beginning of line # 2.
Thanks,
Thierry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|