Info Posted July 8, 2009 Share Posted July 8, 2009 (edited) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 314, 45, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 8, 8, 65, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetStyle($Button1,"",$WS_EX_CLIENTEDGE) GUISetState(@sw_hide) GUISetState(@sw_show) EndSwitch WEnd notice the GUISetState(@sw_hide) and the GUISetState(@sw_show), I tried "refreshing" the GUI but it still doesn't work Edited July 8, 2009 by Info Link to comment Share on other sites More sharing options...
Yashied Posted July 8, 2009 Share Posted July 8, 2009 GUICtrlSetStyle($Button1, -1, $WS_EX_CLIENTEDGE) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Info Posted July 8, 2009 Author Share Posted July 8, 2009 ??? doesn't work... Link to comment Share on other sites More sharing options...
martin Posted July 8, 2009 Share Posted July 8, 2009 ??? doesn't work... I think you can't change the style of a button to certain styles. You could delete it and create it again. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 314, 45, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 8, 8, 65, 25) GUISetState(@SW_SHOW) #EndRegion### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ;GUICtrlSetStyle($Button1, -1, $WS_EX_CLIENTEDGE) GUICtrlDelete($Button1) $Button1 = GUICtrlCreateButton("Button1", 8, 8, 65, 25,-1, $WS_EX_CLIENTEDGE) ;GUISetState(@SW_HIDE);I don't see what these are for ;GUISetState(@SW_SHOW);unless you thought redrawing would help? EndSwitch WEnd Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
wraithdu Posted July 8, 2009 Share Posted July 8, 2009 (edited) Actually, you can change it on the fly, but you have to call SetWindowPos() to update the cache: #include <WindowsConstants.au3> #include <Constants.au3> $gui = GUICreate("test", 200, 200) $b1 = GUICtrlCreateButton("b1", 10, 10, 50, 25) $b2 = GUICtrlCreateButton("b2", 65, 10, 50, 25) GUISetState() Sleep(2000) ConsoleWrite("Now we change the button style..." & @CRLF) GUICtrlSetStyle($b2, -1, $WS_EX_CLIENTEDGE) ConsoleWrite("Nothing happened? Let's try this..." & @CRLF) Sleep(2000) $call = DllCall("user32.dll", "int", "SetWindowPos", "hwnd", GUICtrlGetHandle($b2), "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, _ "uint", BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER, $SWP_FRAMECHANGED)) ConsoleWrite("Return: " & $call[0] & @CRLF) ConsoleWrite("Ah, the sweet taste of victory." & @CRLF) Do Until (GUIGetMsg() = -3) Edited July 8, 2009 by wraithdu Link to comment Share on other sites More sharing options...
Info Posted July 9, 2009 Author Share Posted July 9, 2009 Thanks 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