Jump to content

disable


Cloudsx
 Share

Recommended Posts

uhm disable function of Guicreate or button

i want to disable this one

$militair = GUICtrlCreateButton("militair",290,125,60)

that we can't enter the militair page

and if then i build a building like militair base that is enable so we can enter

Edited by Cloudsx
Link to comment
Share on other sites

  • Moderators

Look at the include file GUIConstants.au3, it will give you information you need to enable/disable etc...

You can also look at GUI Control Styles in the help file for other items for GUI controls.

One button, with a really bad explination is not going to get you a 'good' answer, post your script and comment what you want in the script and maybe you could get a 'great/good' answer.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("My GUI state") ; will create a dialog box that when displayed is centered

$label = GUICtrlCreateLabel ("my disable label", 10,20)
GUICtrlSetState(-1,$GUI_DISABLE); the label is in disable state
                
$button = GUICtrlCreateButton ("my button", 50,50)
GUICtrlSetState(-1,$GUI_FOCUS)          ; the focus is on this button

GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $button Then
        GUICtrlSetState( $label,$GUI_ENABLE)
    EndIf
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...