Kaba Posted September 7, 2011 Posted September 7, 2011 Hi I'm struggling with a strange phenomenon. I used the '$WS_SIZEBOX' GUI style in order to make my GUI resizable. The problem is that this type cuts some pixels of the window's height. Here is my example. Example 1 - Resizable GUI ;;;;;Resizable GUI;;;;;; HotKeySet("{ESC}", "MyExit") #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("Resizable GUI", 250, 250, 350, 200, $WS_SIZEBOX) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func MyExit() Exit EndFunc Example 2 - Non-Resizable GUI ;;;;;Non-Resizable GUI;;;;;; HotKeySet("{ESC}", "MyExit") #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("NON-Resizable GUI", 250, 250, 350, 200) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func MyExit() Exit EndFunc If you compare both windows you will see that the resizable one is a bit shorter than the non-resizable one. Does anyone know what's the reason for that? Kaba
Zedna Posted September 7, 2011 Posted September 7, 2011 (edited) Width/Height in GUICreate mean "client area" size, not window size. Edited September 7, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Kaba Posted September 7, 2011 Author Posted September 7, 2011 Thank you for your answer Zedna, But '$WS_SIZEBOX' also seems to cut the client area. Example 1a - Resizable GUI ;;;;;Resizable GUI;;;;;; HotKeySet("{ESC}", "MyExit") #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("Resizable GUI", 250, 250, 350, 200, $WS_SIZEBOX) $button = GUICtrlCreateButton("", 25, 190, 200, 50) GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHCENTER + $GUI_DOCKSIZE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func MyExit() Exit EndFunc Example 2a - Non - Resizable GUI ;;;;;Non-Resizable GUI;;;;;; HotKeySet("{ESC}", "MyExit") #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("NON-Resizable GUI", 250, 250, 350, 200) $button = GUICtrlCreateButton("", 25, 190, 200, 50) GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHCENTER + $GUI_DOCKSIZE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func MyExit() Exit EndFunc
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