Sign in to follow this  
Followers 0
sandin

Controls not related to GUI's size(?)

4 posts in this topic

I want to set controls not related to the GUI's size, so when I click on the button in my script's example, I want for button to be below GUI's size and I want for label to stay in that exact position it has now, but button keeps following the GUI's size, and so does the label.

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 385, 198, 193, 115)
$Label1 = GUICtrlCreateLabel("ALabel1", 150, 50, 90, 25)
$Button1 = GUICtrlCreateButton("AButton1", 112, 170, 129, 25, 0)
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            $pos = WinGetPos("AForm1")
            WinMove("AForm1", "", $pos[0], $pos[1], $pos[2], $pos[3]-30)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 385, 198, 193, 115)
$Label1 = GUICtrlCreateLabel("ALabel1", 150, 50, 90, 25)
$Button1 = GUICtrlCreateButton("AButton1", 112, 170, 129, 25, 0)
GUISetState(@SW_SHOW)
GUICtrlSetResizing($Button1,$GUI_DOCKSIZE)
GUICtrlSetResizing($Label1,$GUI_DOCKSIZE)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            $pos = WinGetPos("AForm1")
            WinMove("AForm1", "", $pos[0], $pos[1], $pos[2], $pos[3]-30)
    EndSwitch
WEnd

try that,might work

Edited by dbzfanatic

Share this post


Link to post
Share on other sites

Or do you mean like this:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 385, 198, 193, 115)
$Label1 = GUICtrlCreateLabel("ALabel1", 150, 50, 90, 25)
$Button1 = GUICtrlCreateButton("AButton1", 112, 170, 129, 25, 0)
GUISetState(@SW_SHOW)
GUICtrlSetResizing($Button1,$GUI_DOCKTOP)
GUICtrlSetResizing($Label1,$GUI_DOCKTOP)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            $pos = WinGetPos("AForm1")
            WinMove("AForm1", "", $pos[0], $pos[1], $pos[2], $pos[3]-30)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Or do you mean like this:

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 385, 198, 193, 115)
$Label1 = GUICtrlCreateLabel("ALabel1", 150, 50, 90, 25)
$Button1 = GUICtrlCreateButton("AButton1", 112, 170, 129, 25, 0)
GUISetState(@SW_SHOW)
GUICtrlSetResizing($Button1,$GUI_DOCKTOP)
GUICtrlSetResizing($Label1,$GUI_DOCKTOP)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            $pos = WinGetPos("AForm1")
            WinMove("AForm1", "", $pos[0], $pos[1], $pos[2], $pos[3]-30)
    EndSwitch
WEnd
thank you, it works. :)

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