Jump to content

How to stop GUICtrlEdit from scrolling on update?


foster74
 Share

Recommended Posts

I'm going crazy here =/ I haven't been able to figure out how to stop my EditCtrl from scrolling to the last line when it's updated. What I'm after is if the scroll bar isn't on the bottom when the Control is updated, then for the update to not cause it to auto scroll to last line, but if it is on bottom line when updated, for it to stay there, (e.g., AIM). Pretty much anything to send me near the right direction is what I'm after, I appreciate any and all suggestions, thank you.

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

Opt("GUIOnEventMode", 1)
$hGUI = GUICreate("gui", 700, 272)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$hEdit = GUICtrlCreateEdit ('','2','2','694','268', BitOR($ES_READONLY, $ES_LEFT, $WS_VSCROLL))
GUICtrlSetFont (-1, '10','','','Lucida Sans Unicode')
GUICtrlSetBkColor (-1, '0xFFFFFF')
GUISetState()
_GUICtrlEdit_SetMargins($hEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 2, 2)
_GUICtrlEdit_SetText($hEdit, '1' & @CRLF & '2' & @CRLF & '3' & @CRLF& '4' & @CRLF& '5' & @CRLF& '6' & @CRLF& '7' & @CRLF& '8' & @CRLF& '9' & @CRLF& '10' & @CRLF& '11' & @CRLF& '12' & @CRLF& '13' & @CRLF& '14' & @CRLF & '15')

For $i = 16 to 1000
    sleep(1500)
    _Write($i)
Next

Func _Write ($Data)
    _GUICtrlEdit_AppendText($hEdit,@CRLF & $Data)
EndFunc

Func CLOSEClicked()
  $answer = msgbox(262148, "Exit", "Are you sure you want to exit?")
    If $answer = 6 Then
        Exit
    EndIf
EndFunc
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...