Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jumping to a specific line number in a RichEdit Text box
#1
I have used the RichEditHighlight function to "paint" some selected text but often this text is below the viewing area (i.e. you have to scroll down to it to see the highlight.)
I am able to determine how many lines into the text the highlighted function is and I can do a rep statement with the Down arrow to get there but this takes time on the screen...you actually see the cursor "cruising" down the left side of the screen the 20-30 separate times it takes to get there....

Is there any way to jump the cursor to the selected text?

Thanks,
Stuart
#2
not exactly "jumping to a line number" but it does get me to the highlighted text!!!!

Function SwapSelectedForSubmittedText
Code:
Copy      Help
SendMessage(reportcid EM_SETSEL AllTextPrecedingSelectionLength AllTextPrecedingSelectionLength+SelectedTextLength);; i+length)

By "selecting it" it brings the focus there - I can unselect it (to see the highlighting) by giving a 'L left arrow key.
Is there a way to jump there without actually "selecting" it...kind of like:
SELFLAG_TAKEFOCUS

Stuart
#3
Don't remember but rich edit control should have message to get first visible line number, and another message to scroll specified number of lines. Then you have to calculate how many lines to scroll... Or maybe that another message is WM_VSCROLL.


Forum Jump:


Users browsing this thread: 1 Guest(s)