 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Thu Apr 16, 2009 5:44 pm Post subject: basic question: how do you give an ID to a gui item? |
|
|
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
|
Posted: Thu Apr 16, 2009 5:48 pm Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Thu Apr 16, 2009 6:12 pm Post subject: |
|
|
| 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
|
Posted: Thu Apr 16, 2009 6:26 pm Post subject: |
|
|
this
| Code: | Gui, Add, Button, x370 gClicky, Click me
GuiControl, Hide, gClicky |
totally doesn't work -- it complains about the first line!
any ideas? |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 758 Location: Florida
|
Posted: Thu Apr 16, 2009 6:35 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|