Sign in to follow this  
Followers 0
oMBRa

WinMove

6 posts in this topic

here is my code:

#include <GUIConstantsEx.au3>

$window = GUICreate('GUI', 200, 100)
$button = GUICtrlCreateButton('click', 50, 50)
$button2 = GUICtrlCreateButton('button', 250, 50)
GUISetState()
Global $state = False
While 1
    $msg = GUIGetMsg()
    If $msg = $button Then
        $state = Not $state
        If $state = True Then
            WinMove($window, '', Default, Default, 350)
        ElseIf $state = False Then
            WinMove($window, '', Default, Default, 200)
        EndIf
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf
WEnd

why ''button2'' doesnt appear?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

because the gui is 200 pix in width and the button starts at 250pix from left.

:mellow:

You didn't set a resizing, so the ctrls are moved.

#include <GUIConstantsEx.au3>

$window = GUICreate('GUI', 200, 100)
$button = GUICtrlCreateButton('click', 50, 50)
GUICtrlSetResizing(-1, 802)
$button2 = GUICtrlCreateButton('button', 250, 50)
GUICtrlSetResizing(-1, 802)
GUISetState()
Global $state = False
While 1
    $msg = GUIGetMsg()
    If $msg = $button Then
        $state = Not $state
        If $state = True Then
            WinMove($window, '', Default, Default, 350)
        ElseIf $state = False Then
            WinMove($window, '', Default, Default, 200)
        EndIf
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf
WEnd
Edited by senthor

Share this post


Link to post
Share on other sites

yes I know it... but how to make the effect that Im trying to do?

Share this post


Link to post
Share on other sites

There was a slide-in/out script I saw a while back, why not look it up? Also I doubt that the button will be drawn at any point unless you draw it after resizing the window.

Share this post


Link to post
Share on other sites

You didn't set a resizing, so the ctrls are moved.

#include <GUIConstantsEx.au3>

$window = GUICreate('GUI', 200, 100)
$button = GUICtrlCreateButton('click', 50, 50)
GUICtrlSetResizing(-1, 802)
$button2 = GUICtrlCreateButton('button', 250, 50)
GUICtrlSetResizing(-1, 802)
GUISetState()
Global $state = False
While 1
    $msg = GUIGetMsg()
    If $msg = $button Then
        $state = Not $state
        If $state = True Then
            WinMove($window, '', Default, Default, 350)
        ElseIf $state = False Then
            WinMove($window, '', Default, Default, 200)
        EndIf
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf
WEnd

Share this post


Link to post
Share on other sites

yes GUICtrlSetResizing(-1, 802) is what I missed, thx senthor

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