 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
JanHeuer Guest
|
Posted: Wed Nov 16, 2005 3:26 pm Post subject: Gui Button Problem |
|
|
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
|
Posted: Wed Nov 16, 2005 4:18 pm Post subject: |
|
|
Hi Jan,
the var A_GuiControl must be used without the %
Good luck,
Andre |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Wed Nov 16, 2005 4:21 pm Post subject: |
|
|
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 |
|
 |
neyon
Joined: 29 May 2005 Posts: 34 Location: The Netherlands
|
Posted: Wed Nov 16, 2005 4:23 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|