Skip to main content
GameDev.net gamedev.net
🔒 Locked

RichEdit Scrolling Problem

Started by Evil Bill Jan 10, 2003 at 8:33 AM 1 replies 200+ views
Original Post
Evil Bill
Evil Bill
Hey, does anyone know how to scroll a RichEdit control so that newly added text is visible at the bottom of the control? At the moment, i''m scrolling it down one line for every ''\n'' i find, but if a line wraps round (if its a long line), it takes up more than one line. Taaa
Member of the Unban Mindwipe Society (UMWS)
Burning_Ice
Burning_Ice
i use this:

  
// little trick to get the last line written on the bottom of the control

SendMessage ( WindowHandle, EM_SETSEL, (WPARAM)(INT)60000, (LPARAM)(INT)60000);
SendMessage ( WindowHandle, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0 );


basically i use the fact that if i pass a position thats higher then the char count (the 60000) the caret gets automatically set to the last position, so then i just scroll there.
it''s a bit of a hack, but it works



Runicsoft -- home of my open source Function Parser and more
Evil Bill
Evil Bill
Ah cool! Thanks!

Member of the Unban Mindwipe Society (UMWS)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.