Sign in to follow this  
Followers 0
WolfWorld

How to make hole gui dragable by draging a disable control

3 posts in this topic

Hi,

#include <GUIConstants.au3>

$Gui = GUICreate(":-)", 150, 45, -1, -1, -1)
$Button1 = GUICtrlCreateButton("Button 1", 10, 10, 60, 25)
$Label1 = GUICtrlCreateLabel("", 10, 10, 60, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
GUICtrlSetState(-1, $GUI_HIDE)
$Button2 = GUICtrlCreateButton("Button 2", 80, 10, 60, 25)
GUICtrlSetState($Button2, $GUI_DISABLE)
$Label2 = GUICtrlCreateLabel("", 80, 10, 60, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )
GUISetState(@SW_SHOW, $Gui)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetState($Button1, $GUI_DISABLE)
            GUICtrlSetState($Button2, $GUI_ENABLE)
            GUICtrlSetState($Label1, $GUI_SHOW)
            GUICtrlSetState($Label2, $GUI_HIDE)
        Case $Button2
            GUICtrlSetState($Button1, $GUI_ENABLE)
            GUICtrlSetState($Button2, $GUI_DISABLE)
            GUICtrlSetState($Label1, $GUI_HIDE)
            GUICtrlSetState($Label2, $GUI_SHOW)
    EndSwitch
WEnd

Cheers

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