Cotino Posted December 12, 2016 Posted December 12, 2016 (edited) Hi, I create a graphic through GUICtrlCreateGraphic, make a nice beautiful reactangle, then show the gui. After that, i want to create another rectangle, however it just won't show. If i hide and then show the GUI again, the rectangle appear. Is there any way to show the rectangle without having to go through that ? Having the window flicker as it hides then show again is not ideal. #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $GUI1 = GUICreate("GUI1", 200, 200, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "EndGUI", $GUI1) $graphic = GUICtrlCreateGraphic(0, 0, 200, 200) GUICtrlSetGraphic($graphic, $GUI_GR_COLOR, 0xFF0000, 0xFF0000) GUICtrlSetGraphic($graphic, $GUI_GR_RECT, 10, 10, 180, 180) $GUI2 = GUICreate("GUI2", 200, 200, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "EndGUI", $GUI2) GUISetState(@SW_SHOW, $GUI1) MsgBox(0,"","Creating blue rectangle") GUICtrlSetGraphic($graphic, $GUI_GR_COLOR, 0x0000FF, 0x0000FF) GUICtrlSetGraphic($graphic, $GUI_GR_RECT, 50, 50, 100, 100) GUISetState(@SW_HIDE, $GUI1) ; // Comment these 2 and the blue rectangle won't appear GUISetState(@SW_SHOW, $GUI1) ; // While 1 Sleep(1000) WEnd Func EndGUI() Exit EndFunc Edit : typo My bad, found the answer myself. Add GUICtrlSetGraphic($graphic,$GUI_GR_REFRESH) Edited December 12, 2016 by Cotino
spudw2k Posted December 12, 2016 Posted December 12, 2016 Glad you solved it, and thank you for sharing your solution. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
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