Jump to content

AutoIt GUI Edit Control


 Share

Recommended Posts

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 ...

Link to comment
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)
Link to comment
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...

Link to comment
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.

 

Link to comment
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.

Link to comment
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.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...