Sign in to follow this  

Auto scrolling to bottom of edit box?

Recommended Posts

lonewolff    1182

Hi Guys,


I have a multiline edit box (non-MFC) in pure c++ and can display text happily in it.


But how do I make the edit box scroll automatically to the bottom of the text (once the edit box has filled up). At the moment I have to scroll manually.


This is my edit boxcreation code


strcpy(buffer,"Some text \r\n");


Any advice would be awesome :)

Share this post

Link to post
Share on other sites
lonewolff    1182

This should do what you want


EDIT: But since it isn't on a dialog you don't need to call GetDlgItem, just use the edit hWnd directly.



Thanks for your reply. Just tried this. But, this seems to only select the text and doesn't actually scroll to the bottom of the editbox unfortunately.



Although you did put me on the right track :)


SendMessage( hEdit, EM_LINESCROLL , 0, 65535 );

Edited by DarkRonin

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this