Jump to content
Sign in to follow this  
ZanaxNL

[Question] ScrollDownGUI

Recommended Posts

ZanaxNL

Hey,

Which command i need to automatic scroll down when a new line is set in a GuiCreateEDIT ?

Thanks : )

Zanax

Share this post


Link to post
Share on other sites
BinaryBrother

Take a look at.

_GUICtrlEdit_Scroll($hWnd, $iDirection)
_GUICtrlRichEdit_ScrollLines($hWnd, $iQlines)

_GUICtrlRichEdit_ScrollLineOrPage($hWnd, $sAction)

The help file is full of various ways to accomplish that.

_GUICtrlEdit_AppendText($hWnd, $sText)

May scroll to the bottom automatically as well... I can't remember.

Share this post


Link to post
Share on other sites
BinaryBrother

You need the $ES_AUTOVSCROLL style set on the edit.

I was looking for that... Yea, that's definitely the best way... Posted Image

Share this post


Link to post
Share on other sites
ZanaxNL

Ok thanks for reply's

but the problem was.

let giv my scirpt a part:

$edit = GUICtrlCreateEdit("[" & $Time & "]" & " #### at"& @CRLF & "[" & $Time & "]" & " ####", 16, 200, 217, 46, $WS_VSCROLL + $ES_READONLY + $ES_AUTOVSCROLL)

And then (if button is pressed)

If $x=1 Then
guictrlsetdata($edit,guictrlread($edit)&  @CRLF & "[" & $Time & "]" & " Started" )
endif

But how i he autoscroll down, when new line is set?

Thanks!! already

Zanax ;)

Share this post


Link to post
Share on other sites
BinaryBrother

#include <WindowsConstants.au3>
#include <EditConstants.au3>
$Time = "3:45PM"
$GUI = GUICreate("Title", 300, 300)
$Edit = GUICtrlCreateEdit("[" & $Time & "]" & " #### at"& @CRLF & "[" & $Time & "]" & " ####", 0, 0, 300, 300, $WS_VSCROLL + $ES_READONLY + $ES_AUTOVSCROLL)
GUISetState(@SW_SHOW, $GUI)

While 1
    Sleep(500)
    GUICtrlSetData($Edit, "Alright" & @CRLF, 1)
WEnd

The above script scrolls properly... The only difference I see is that your not using the last parameter in

GUICtrlSetData()... Which should be set to "1" which will actually "append" the text. As shown in the help-file.

GUICtrlSetData ( controlID, data [, default] )

default [optional]

Combo, List: The default value.

Edit, Input: If non-empty (""), the string is inserted at the current insertion point (caret).

Edited by BinaryBrother

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  

×