zeffy Posted August 26, 2010 Posted August 26, 2010 Whenever I use GUICtrlSetData on a text box, the text always gets highlighted, no matter what I do. The only way I have figured out how to fix it is to send a ControlClick() to the edit box, but I want a more reliable way to do it. Here is a scenario script: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("ChangeLog", 625, 443, Default, Default, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS)) GUICtrlCreateEdit("", 0, 0, 625, 443, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetData(-1, BinaryToString(InetRead("http://www.autoitscript.com/autoit3/files/beta/update.dat"))) GUICtrlSetFont(-1, 10, 400, 0, "Consolas") GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
funkey Posted August 26, 2010 Posted August 26, 2010 First show the Gui and then update the edit control #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> GUICreate("ChangeLog", 625, 443);, Default, Default, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS)) $hEdit = GUICtrlCreateEdit("", 0, 0, 625, 443);, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetFont(-1, 10, 400, 0, "Consolas") GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() GUICtrlSetData(-1, "This is some text!") Do Sleep(20) Until GUIGetMsg() = $GUI_EVENT_CLOSE Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
zeffy Posted August 26, 2010 Author Posted August 26, 2010 Haha, wow I can't believe I didn't think of that. Thanks.
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