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 

Gui Button Problem

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





PostPosted: Wed Nov 16, 2005 3:26 pm    Post subject: Gui Button Problem Reply with quote

Hello,

I just have the problem that I need within a large AHK script a GUI window, where the user may choose to print the data or to copy the data to the PDA or to do both! After that the window should disappear.
This is the script part:
Remark: The Goto,PRINT and PDA are other parts of my script !

Code:

Gui, Add, Button, x50 y160 w90 h30 vB1 gButtons,PDA
Gui, Add, Button, x150 y160 w90 h30 vB2 gButtons,PRINT
Gui, Add, Button, x250 y160 w90 h30 vB3 gButtons,BOTH
Gui, Add, Button, x350 y160 w90 h30 vB4 gButtons, Cancel
Gui, Add, Text, x66 y60 w380 h60 +Center, What do you want?
Gui, Font, S14 CDefault Bold, Verdana
Gui, Show, x270 y110 h231 w460, Bitte wählen Sie:
return
Buttons:
If %A_GuiControl% = B1
   Goto,PDA

If %A_GuiControl% = B2
   Goto,PRINT

If %A_GuiControl% = B3

Goto,PRINT

If %A_GuiControl% = B4
   ExitApp
Return
Gui,destroy


The GUI window shows up. But if you press a button the GOTO is not realized.
I have no idea what goes wrong. Probably anyone can tell me how I realize this options box.

Thanks Jan
Back to top
Andre



Joined: 22 Jul 2005
Posts: 52

PostPosted: Wed Nov 16, 2005 4:18 pm    Post subject: Reply with quote

Hi Jan,

the var A_GuiControl must be used without the %

Good luck,

Andre
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Wed Nov 16, 2005 4:21 pm    Post subject: Reply with quote

You have two choices.

You could use specific g-lables, e.g.
Code:
Gui, Add, Button, gPDA,PDA
which will then execute that exact routine.

or you have to remove the % in your code, e.g.
Code:
If A_GuiControl = B1

_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
neyon



Joined: 29 May 2005
Posts: 34
Location: The Netherlands

PostPosted: Wed Nov 16, 2005 4:23 pm    Post subject: Reply with quote

This one works for me:

Code:

Gui, Add, Button, x50 y160 w90 h30 vB1 gButtons,PDA
Gui, Add, Button, x150 y160 w90 h30 vB2 gButtons,PRINT
Gui, Add, Button, x250 y160 w90 h30 vB3 gButtons,BOTH
Gui, Add, Button, x350 y160 w90 h30 vB4 gButtons, Cancel
Gui, Add, Text, x66 y60 w380 h60 +Center, What do you want?
Gui, Font, S14 CDefault Bold, Verdana
Gui, Show, x270 y110 h231 w460, Bitte wählen Sie:
return
Buttons:
If A_GuiControl = B1
   msgbox,1

If A_GuiControl = B2
   msgbox,2

If A_GuiControl = B3
   msgbox,3

If A_GuiControl = B4
   msgbox,4 End...
   ExitApp


Neyon
_________________
Greetz,
Neyon
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