Sign in to follow this  
Followers 0
Kaba

$WS_SIZEBOX makes GUI shorter

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0