Get last visible line of RichTextBox 
Author Message
 Get last visible line of RichTextBox

How do I get the line number of the last visible line (not
the last line of the text, but the last line in the
visible area) of a RichTextBox? Thanks.


Sat, 07 Feb 2004 04:45:23 GMT  
 Get last visible line of RichTextBox
Hi Sau,

I think you will have to use GetCharIndexFromPosition passing it the
cordinates of the bottom of the rtf box or there abouts, then call
GetLineFromCharIndex. Jsut make sure GetCharIndexFromPosition returns an
actual char index, not 0 (or -1 ?)


Quote:
> How do I get the line number of the last visible line (not
> the last line of the text, but the last line in the
> visible area) of a RichTextBox? Thanks.



Sat, 07 Feb 2004 16:24:22 GMT  
 Get last visible line of RichTextBox
Hi Bill,

Thank you very much for your suggestion.  It took me a while to figure out how to get the coordinates of the bottom of the RTF box.  But once I got that, GetCharIndexFromPosition and GetLineFromCharIndex gave me exactly what I needed.  Thanks!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 08 Feb 2004 22:04:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Current number of lines visible in RichTextBox????

2. Can't get richtextbox to scroll down to last line after update

3. How to see always the last line in a RichTextBox

4. Delete LAST line in RichTextBox: HOW

5. Getting each line from a text box (or RichTextBox)

6. Textbox/label which add a new line and remove the last line

7. Last Visible Item

8. Listview : make last added item visible everytime ?

9. Scroll line by line in RichTextBox

10. ListView: How to make the last column visible.

11. RichTextBox - Determine if text is currently visible

12. Read Last word of richtextbox

 

 
Powered by phpBB® Forum Software