Jump to content
Sign in to follow this  
abiteric

how to change Form1 size

Recommended Posts

abiteric

#include <GUIConstants.au3>
$Form1 = GUICreate("TEST",300,300,300,300)
$btn_test = GUICtrlCreateButton("Change Form1 Size", 100, 100, 130, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $btn_test  
        GUICtrlSetPos($form1,2,2,200,200)
        MsgBox(0,@error,@extended)
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

as the code , no error but not work ...

somebody whould tell me how to change Form1 size ? very appreciate


My website about Y-mate 網拍輔助程式 : http://www.L2play.comMy Blog ( Tranditional Chinese ) 開發小組的部落格 : http://tw.myblog.yahoo.com/play19990909

Share this post


Link to post
Share on other sites
Mison

Use WinMove():

#include <GUIConstants.au3>
$Form1 = GUICreate("TEST",300,300,300,300)
$btn_test = GUICtrlCreateButton("Change Form1 Size", 100, 100, 130, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $btn_test  
        WinMove($Form1,2,2,200,200)
        MsgBox(0,@error,@extended)
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

Hi ;)

Share this post


Link to post
Share on other sites
Mat

Use WinMove():

#include <GUIConstants.au3>
$Form1 = GUICreate("TEST",300,300,300,300)
$btn_test = GUICtrlCreateButton("Change Form1 Size", 100, 100, 130, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $btn_test  
        WinMove($Form1,2,2,200,200)
        MsgBox(0,@error,@extended)
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

WinMove needs the second parameter for text... try: WinMove($Form1, "", 2, 2, 200, 200)

Share this post


Link to post
Share on other sites
Mison

Thanks for pointing that out, Mat. ;)


Hi ;)

Share this post


Link to post
Share on other sites
Mison

What happen if you resize the window by the mouse? Does it behaves differently?


Hi ;)

Share this post


Link to post
Share on other sites
trung0407

set the size of the control relative to the main window ie as soon as main window changes its size, change the size of the controls as well

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  

×