 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jimmyj
Joined: 26 May 2005 Posts: 18
|
Posted: Tue Jun 07, 2005 2:13 pm Post subject: multiple gui buttons?? |
|
|
i know this is simple but i'm stumped..still learning all of this...
i want to have multiple buttons within one GUI/scripts...i can't seem to get the second button identified apart from the first....I tried button2, 2button...but i think i'm missing something
--------------------------------------------------------------------------------------
Gui, Add, Text, y+35, test
Gui, Add, text, x60 y80 w100 h37, Enter 7 digit Number To Display Customer General Data:
Gui, Add, Edit, vVar number limit7
Gui, add, Button, default,OK
Gui, Add, button, x250 y120 w100 h37, Click OK to View List of Contracts:
Gui, add, Button, default,OK ;SECOND BUTTON
Gui, Show, x285 y151 h377 w477, test
Return
ButtonOK: ;HELP ME OUT HERE
send, va45
sleep, 500
send, {enter}
Return
Buttonok: ; THIS WORKS FINE
GuiControlGet, Var
Gui, submit
Send, %var%
Send, {enter} |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Tue Jun 07, 2005 2:33 pm Post subject: |
|
|
Use g-labels instead. _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
AGU Guest
|
Posted: Tue Jun 07, 2005 2:33 pm Post subject: |
|
|
Hmmm,
I don't understand your problem very well. But maybe you should check the Gui documentation - especially "g-Labels" This can come in quite helpful.
You'll find the explanation under "Options for Assigning Actions and Variables to Controls"
http://www.autohotkey.com/docs/commands/Gui.htm#Events |
|
| Back to top |
|
 |
jimmyj
Joined: 26 May 2005 Posts: 18
|
Posted: Tue Jun 07, 2005 3:36 pm Post subject: G-LABELS... |
|
|
can someone give me an example or a start on the below...i'm not familiar with as to get started...
Gui, Add, Text, y+35, test
Gui, Add, text, x60 y80 w100 h37, Enter 7 digit Number To Display Customer General Data:
Gui, Add, Edit, vVar number limit7
Gui, add, Button, default,OK
Gui, Add, button, x250 y120 w100 h37, Click OK to View List of Contracts:
Gui, add, Button, default,OK ;SECOND BUTTON
Gui, Show, x285 y151 h377 w477, test
Return
ButtonOK: ;HELP ME OUT HERE
send, va45
sleep, 500
send, {enter}
Return
Buttonok: ; THIS WORKS FINE
GuiControlGet, Var
Gui, submit
Send, %var%
Send, {enter} |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Tue Jun 07, 2005 3:42 pm Post subject: |
|
|
| Code: | Gui, Add, Text, y+35, test
Gui, Add, text, x60 y80 w100 h37, Enter 7 digit Number To Display Customer General Data:
Gui, Add, Edit, vVar number limit7
Gui, add, Button, default,OK
Gui, Add, button, gok1 x250 y120 w100 h37, Click OK to View List of Contracts:
Gui, add, Button, gok2 default,OK ;SECOND BUTTON
Gui, Show, x285 y151 h377 w477, test
Return
ok1:
send, va45
sleep, 500
send, {enter}
Return
ok2:
GuiControlGet, Var
Gui, submit
Send, %var%
Send, {enter} |
ps - use the code tags, it makes it much easier for others to read.  _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
jimmyj
Joined: 26 May 2005 Posts: 18
|
Posted: Tue Jun 07, 2005 3:54 pm Post subject: thanx..works fine..eom |
|
|
| ... |
|
| Back to top |
|
 |
Pasukun
Joined: 16 Dec 2004 Posts: 84
|
Posted: Tue Jun 07, 2005 5:01 pm Post subject: |
|
|
I believe you have to give each button a unique name, as long as they are on the same GUI.
And looks like you have 2 "OK" buttons on the same GUI.
If you rename 2nd button as "SUBMIT" or "DONE" that will fix your problem. _________________
"the things we touch have no permanence. my master would say: there is nothing we can hold onto in this world.. only by letting go can we truly possess what is real..." |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Tue Jun 07, 2005 7:16 pm Post subject: |
|
|
It was a little hard for me understanding what your code should do.
I assume you want to enter the user a 7-digit-number, then
send the keys "va45", wait a little, send Enter, send 7-digit-number,
send Return.
Is this right?
| Code: | Gui, Add, Text, y+35, test
Gui, Add, text, x60 y80 w100 h37, Enter 7 digit Number To Display Customer General Data:
Gui, Add, Edit, vMyDigitVar number limit7
Gui, add, Button, gMyOkButton, OK
Gui, Show, x285 y151 h377 w477, test
Return
MyOkButton:
MsgBox, hello
Gui, Submit, nohide
send, va45
sleep, 500
send, {enter}
Send, %var%
Send, {enter}
return
|
But I am not sure where you want to send this data (to what program)?
Maybe I was wrong  _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| 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
|