Jump to content
Sign in to follow this  
rajeshontheweb

Why does this happen, controls resized by few pixels?

Recommended Posts

rajeshontheweb

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>


opt("GUIResizeMode",$GUI_DOCKALL)

$frmMain = GUICreate("TestingGUI",350,350)

GUICtrlSetBkColor(GUICtrlCreateLabel("350x350",1,1,348,1),0x00FFFF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x350",1,348,348,1),0x00FFFF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x350",1,1,1,348),0x00FFFF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x350",348,1,1,348),0x00FFFF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x125",1,1,123,1),0xFF00FF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x125",1 ,123,348,1),0xFF00FF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x125",1,1,1,123),0xFF00FF)
GUICtrlSetBkColor(GUICtrlCreateLabel("350x125",348,1,1,123),0xFF00FF)

GUICtrlSetState(-1,128)

$btn_Resize_ActiveWindow = GUICTrlCreateButton("Resize using Active Window constants",50,75,250)
$btn_Resize_Default = GUICTrlCreateButton("Resize using 'Default' Keyword",50,125,250)


GUISetState()


Func Resize_click1()
$ActWinDim= WinGetPos("[active]")

Msgbox(4096,"","resizing to 350 x 125 ")
WinMove ( "TestingGUI", "",$ActWinDim[0],$ActWinDim[1],350,125)
Msgbox(4096,"","resizing to 350 x 350 ")
WinMove ( "TestingGUI", "", $ActWinDim[0],$ActWinDim[1],350,350)

EndFunc 


Func Resize_click2()
$ActWinDim= WinGetPos("[active]")

Msgbox(4096,"","resizing to 350 x 125 ")
WinMove ( "TestingGUI", "",Default,Default,350,125)
Msgbox(4096,"","resizing to 350 x 350 ")
WinMove ( "TestingGUI", "",Default,Default,350,350)

EndFunc

why does this happen?? where am i wrong?

i have drawn two lines to show the difference...

Share this post


Link to post
Share on other sites
rajeshontheweb

Share this post


Link to post
Share on other sites
rajeshontheweb

is this abug or what????

the window does not come back to 350 x 350 at all????

can anyone confirm if there is anything i am missing, please?

just noticed something, Au3info tool tells me some different story

GUI Created first 356 x 382

After resising, it is 350 x 350

Edited by rajeshontheweb

Share this post


Link to post
Share on other sites
martin

is this abug or what????

the window does not come back to 350 x 350 at all????

can anyone confirm if there is anything i am missing, please?

just noticed something, Au3info tool tells me some different story

GUI Created first 356 x 382

After resising, it is 350 x 350

Unfortunately, GuiCreate has an inconsistent way (to me and probably many other people) of dealing with window sizes. When you create a window the size you specify is usually, but not always, the client width and height. (See this for an exception.) The window is then created with borders and a caption added if they are part of the style.

ASAIK, when you resize a window the size always refers to the overall window size.

Edited by martin

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.

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  

×