Sign in to follow this  
Followers 0
FiNAlzFiNAle

AutoIt GUI Edit Control

6 posts in this topic

Hi,

I need to send text (as response) to the edit control when the user enters command in another input box.

But the user will have to keep scrolling down to view the response from my script.

I would like to know if it is possible to force the GUI Edit control to scroll down to the end automatically.

If this is not possible, then is there anyway to solve my problem ?

Thanks ...

Share this post


Link to post
Share on other sites



Replace $Edit_1 with your edit box variable name.

Vertically scroll to the end of the edit box

Dim $EM_SCROLL = 0x00B6
Dim $EM_GETLINECOUNT = 0x00BA 
Dim $iLines
GUICtrlSetState($Edit_1, $GUI_FOCUS)
$iLines = GUICtrlSendMsg($Edit_1, $EM_GETLINECOUNT, 0, 0)
GUICtrlSendMsg($Edit_1, $EM_SCROLL, 0, $iLines)

Share this post


Link to post
Share on other sites

If I remember correctly I've just used _GUICtrlEditScroll() together with $SB_SCROLLCARET.

@Gary : If you see this, is it in any way possible to get the position of the scrollbar ?

Because I would like to "scroll" the edit-control, but only when the scrollbar is at the

bottom... hope you understand...

Share this post


Link to post
Share on other sites

If I remember correctly I've just used _GUICtrlEditScroll() together with $SB_SCROLLCARET.

@Gary : If you see this, is it in any way possible to get the position of the scrollbar ?

Because I would like to "scroll" the edit-control, but only when the scrollbar is at the

bottom... hope you understand...

You can try EM_GETTHUMB but if I remember correctly I never could get that one to work.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

@Gary : If you see this, is it in any way possible to get the position of the scrollbar ?

Because I would like to "scroll" the edit-control, but only when the scrollbar is at the

bottom... hope you understand...

Just thinking aloud here... maybe you could do a _GUICtrlEditGetLineCount and subtract the height of the edit box in lines. If that number is greater than _GUICtrlEditGetFirstVisibleLine, the edit is not scrolled all the way to the bottom (if it doesn't work, try adding or subtracting 1 from one side of the comparison). It would break if the size of the edit box was changed during execution, though I suppose there must be a solution to that as well.

Share this post


Link to post
Share on other sites

Just thinking aloud here... maybe you could do a _GUICtrlEditGetLineCount and subtract the height of the edit box in lines. If that number is greater than _GUICtrlEditGetFirstVisibleLine, the edit is not scrolled all the way to the bottom (if it doesn't work, try adding or subtracting 1 from one side of the comparison). It would break if the size of the edit box was changed during execution, though I suppose there must be a solution to that as well.

Possibly _GUICtrlEditGetRECT


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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