Sign in to follow this  
Followers 0
Zhelkus

Make Edit box follow scroll down automatically

4 posts in this topic

I'm a noob and this is a noob request. I have an edit control box using this piece of script:

$Edit1 = GUICtrlCreateEdit("", 16, 32, 545, 209, BitOR($ES_READONLY, $WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE))

I have a macro inserting text into it but each time text is inserted the box scrolls back to the top. This doesn't happen if I enter text into it manually, but that isn't the point.

According to the help file, $ES_AUTOVSCROLL will automatically scroll up after each insertion as well. I want the opposite of that. Could somebody please help me?

Share this post


Link to post
Share on other sites



I'm a noob and this is a noob request. I have an edit control box using this piece of script:

$Edit1 = GUICtrlCreateEdit("", 16, 32, 545, 209, BitOR($ES_READONLY, $WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE))

I have a macro inserting text into it but each time text is inserted the box scrolls back to the top. This doesn't happen if I enter text into it manually, but that isn't the point.

According to the help file, $ES_AUTOVSCROLL will automatically scroll up after each insertion as well. I want the opposite of that. Could somebody please help me?

You don't show how you are adding text. Maybe you are reading the text to a variable, adding the extra text to the variable then setting the edit text to the variable using GuiCtrlSetData.

Try using _GUICtrlEdit_AppendText. I think this will set the cursor to the end after appending the text the same as if you insert text manually (^v perhaps)

Otherwise you could do what you currently do then have something like

ControlSend($GuiHandle,"",$editID,"^{END}")


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Zhelkus

Example:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

$hGUI = GUICreate("Test", 300, 200)

$Edit1 = GUICtrlCreateEdit("", 10, 10, 280, 150, BitOR($ES_READONLY, $WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE))

$AddText_Button = GUICtrlCreateButton("Add", 110, 170, 75, 23)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $AddText_Button
            GUICtrlSetData($Edit1, "Hello world!" & @CRLF, 1)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Sorry for the late reply. This is an example of how I was managing the edit box. As you guessed it, martin, I was using a variable :P

Case $Button1
                $sTime = TimerInit()
                $msgEdit1 &= @CRLF & "Looking for a refresher?"
                GUICtrlSetData($Edit1, $msgEdit1)

Thanks for the help guys. :P

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