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 

multiple gui buttons??

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



Joined: 26 May 2005
Posts: 18

PostPosted: Tue Jun 07, 2005 2:13 pm    Post subject: multiple gui buttons?? Reply with quote

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
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Tue Jun 07, 2005 2:33 pm    Post subject: Reply with quote

Use g-labels instead.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
AGU
Guest





PostPosted: Tue Jun 07, 2005 2:33 pm    Post subject: Reply with quote

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

PostPosted: Tue Jun 07, 2005 3:36 pm    Post subject: G-LABELS... Reply with quote

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
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Tue Jun 07, 2005 3:42 pm    Post subject: Reply with quote

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. Smile
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
jimmyj



Joined: 26 May 2005
Posts: 18

PostPosted: Tue Jun 07, 2005 3:54 pm    Post subject: thanx..works fine..eom Reply with quote

...
Back to top
View user's profile Send private message
Pasukun



Joined: 16 Dec 2004
Posts: 84

PostPosted: Tue Jun 07, 2005 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Tue Jun 07, 2005 7:16 pm    Post subject: Reply with quote

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 Confused
_________________
Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat.
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