Sign in to follow this  
Followers 0
AlecSadler

How to scroll an edit to the bottom line?

6 posts in this topic

The title pretty much says it all. Just looking for a simple way to scroll an edit box with text in it, to the bottom line of text, thanks.

Share this post


Link to post
Share on other sites



There's a few ways.

This will move the scroll bar

_GUICtrlRichEdit_SetScrollPos($hWnd, $iX, $iY)

If you don't mind moving the caret

Local $iEditLength = StringLen(GUICtrlRead(Edit Control))
_GUICtrlEdit_SetSel(Handle to the edit control, $iEditLength, $iEditLength)
_GUICtrlRichEdit_ScrollToCaret(Handle to the edit control)

There's also this, you'd have to throw this in a loop [n] amount of times.

; Like you pressed Page Down
_GUICtrlEdit_Scroll($hWnd, $SB_PAGEDOWN)
; or using $SB_LINEDOWN [n] could just be the number of lines to the bottom
_GUICtrlEdit_Scroll($hWnd, $SB_LINEDOWN)

 

Share this post


Link to post
Share on other sites

Or just send ctrl+PgDn :) 


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

I think it's Ctrl+End, if me not wrong... :)

Ctrl+PgDn goes to the next tab or next page in some word versions.

Share this post


Link to post
Share on other sites

Very true :sweating: I stand corrected.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

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  
Followers 0