Gestalt Posted September 9, 2010 Posted September 9, 2010 How can I have the edit control automatically scroll to the very bottom of the control when the script is opened? I have tried doing a ControlSend("^{END}") but that doesn't work. I have looked at GUICtrlSendMsg and I didn't see anything that would help. Is this possible?
enaiman Posted September 9, 2010 Posted September 9, 2010 - get the length of the text in the edit box - set selection from last character - to - last character - replace selection with new content That way it will scroll "up". #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 373, 192, 124) $Edit1 = GUICtrlCreateEdit("", 16, 16, 593, 305) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("Test Me", 272, 336, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 For $i = 1 To 40 _EditScrollUp("Example Line "&$i&@CRLF) Sleep(200) Next EndSwitch WEnd Func _EditScrollUp($content) Local $Ed_length = StringLen(GUICtrlRead($Edit1)) _GUICtrlEdit_SetSel($Edit1, $Ed_length, $Ed_length) _GUICtrlEdit_ReplaceSel($Edit1, $content) EndFunc Xandy 1 SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Gestalt Posted September 10, 2010 Author Posted September 10, 2010 Thank you for the code, enaiman. I am at home and only have Linux computers but I will try it when I get back to work. I appreciate your help.
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