Sign in to follow this  
Followers 0
toothyXdip

Ive always wondered something

3 posts in this topic

#1 ·  Posted (edited)

when somethings control id is a number (like GUICtrlSetState below) where do you find the number and how can a button and a lable have teh same control id number like this scipt from the help menu

#include <GUIConstants.au3>

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

GUICtrlCreateLabel ("my disable label", 10,20)
GUICtrlSetState(-1,$GUI_DISABLE)    ; the label is in disable state
                
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 = $GUI_EVENT_CLOSE Then ExitLoop
Wend

What would the id be if i had 2 buttons and 2 lables and how would i find them?

P.S. like i said before REALLY nooby question

Edited by toothyXdip

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites



Make each control a variable, the variable will hold the control name.

$Main = GUICreate() will hold the hwnd of the GUI

$Edit = GUICtrlCreateEdit() will hold the control id of the Edit control

$Edit2 = GUICtrlcreateEdit() will hold the control id of this edit control etc....


[center]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.[/center]

Share this post


Link to post
Share on other sites

..and how can a button and a lable have teh same control id number like this scipt from the help menu..

They don't have the same controlID, as -1 only refers to the last created control.

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