dwarf Posted September 4, 2019 Share Posted September 4, 2019 i am making a simple gui that changes the background color of the window when a button is pressed , but every time i press one it closes , my question is how do i get to stay open after i press a button ? simplegui.au3 Link to comment Share on other sites More sharing options...
dwarf Posted September 4, 2019 Author Share Posted September 4, 2019 1 minute ago, dwarf said: i am making a simple gui that changes the background color of the window when a button is pressed , but every time i press one it closes , my question is how do i get to stay open after i press a button ? simplegui.au3 1.06 kB · 1 download #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) GUISetBkColor(0xFF0000) Global $Button1 = GUICtrlCreateButton("Red", 184, 32, 75, 25) Global $Button2 = GUICtrlCreateButton("Green", 448, 32, 75, 25) Global $Button3 = GUICtrlCreateButton("White", 96, 32, 75, 25) Global $Button4 = GUICtrlCreateButton("Yellow", 360, 32, 75, 25) Global $Button5 = GUICtrlCreateButton("Blue", 272, 32, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit Case $Button2 Exit Case $Button3 Exit Case $Button4 Exit Case $Button5 Exit EndSwitch WEnd Func Red() GUISetBkColor(0xFF0000) EndFunc Func Blue() GUISetBkColor(0xFF0000) EndFunc Func Yellow() GUISetBkColor(0xFF0000) EndFunc Func Green() GUISetBkColor(0xFF0000) EndFunc Func White() GUISetBkColor(0xFF0000) EndFunc Link to comment Share on other sites More sharing options...
dwarf Posted September 4, 2019 Author Share Posted September 4, 2019 nvm i figured it out Link to comment Share on other sites More sharing options...
Nine Posted September 4, 2019 Share Posted September 4, 2019 @dwarf Next time, when you post code, please use this tool... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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