foster74 Posted March 15, 2009 Share Posted March 15, 2009 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 More sharing options...
Emiel Wieldraaijer Posted March 15, 2009 Share Posted March 15, 2009 I know it´s not a nice solution Replace your _Write ($Data) with the following Func _Write ($Data) _GUICtrlEdit_AppendText($hEdit,@CRLF & $Data) For $i = ($Data - 16) to $Data _GUICtrlEdit_Scroll($hEdit, $SB_LineUp) Next EndFunc Best regards, Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now