AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

basic question: how do you give an ID to a gui item?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Apr 16, 2009 5:44 pm    Post subject: basic question: how do you give an ID to a gui item? Reply with quote

just read the "gui, add" part but it doesn't say where you give an ID to the item -- right now I'm using guicontrol and the full name of the buttons, text fields, etc, but this is cumbersome... what's the parameter please?

I even did a full-text search in the helpfile for "ControlID" (the name of the GuiControl parameter) but this word is only used in GuiControl!

Thanks!
Back to top
Rhys



Joined: 17 Apr 2007
Posts: 758
Location: Florida

PostPosted: Thu Apr 16, 2009 5:48 pm    Post subject: Reply with quote

AFAIK, the id is the name of whatever variable you have assigned to the control. This may not be true/possible for all control types...

Edit: Example:
Code:
gui,add,edit,vThisEdit w200,blah blah
gui,add,button,gClicky,Click
gui,show
return

clicky:
guicontrol,,ThisEdit,%A_Now%
return

guiclose:
exitapp
Return

_________________
[Join IRC!]
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Apr 16, 2009 6:12 pm    Post subject: Reply with quote

Rhys wrote:
AFAIK, the id is the name of whatever variable you have assigned to the control. This may not be true/possible for all control types...

Edit: Example:
Code:
gui,add,edit,vThisEdit w200,blah blah
gui,add,button,gClicky,Click
gui,show
return

clicky:
guicontrol,,ThisEdit,%A_Now%
return

guiclose:
exitapp
Return


Thanks. Why would a button have a variable? What is the g mean, is it a "go-to" label? I can't imagine what else it would stand for. Thanks
Back to top
Guest






PostPosted: Thu Apr 16, 2009 6:26 pm    Post subject: Reply with quote

this
Code:
Gui, Add, Button,  x370 gClicky, Click me
GuiControl, Hide, gClicky


totally doesn't work -- it complains about the first line! Evil or Very Mad

any ideas?
Back to top
Rhys



Joined: 17 Apr 2007
Posts: 758
Location: Florida

PostPosted: Thu Apr 16, 2009 6:35 pm    Post subject: Reply with quote

Try adding a variable name to the button (you have added a gosub name) using vClicky.

When you use guicontrol, drop the 'v' from the name since it's not really part of the variable's name.
Code:

Gui, Add, Button,  x370 vClicky, Click me
GuiControl, Hide, Clicky

_________________
[Join IRC!]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group