 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
schuerm
Joined: 26 Jul 2008 Posts: 7
|
Posted: Wed Sep 10, 2008 8:35 am Post subject: add a tab in gui, 2 |
|
|
Hi, I am trying to add a tab in a gui. Everything works fine if I use
my script without using gui, 2:
But unfortunately I have to use gui, 2: in my current script
Here is what I am trying to do in a sample script:
| Code: |
tab_control = First Tab
gui, 2: Add, Tab2,w500, %tab_control% ; Tab2 vs. Tab requires v1.0.47.05.
gui, 2: Tab
gui, 2: Add, Button, default xm, OK
gui, 2: Show, ,my_tabs
return
ButtonOK:
tab_control = %tab_control%|Second Tab
GuiControl,, SysTabControl321, |%tab_control% ; problem here???
gui, 2: tab, 2
gui, 2: add, text,, adadsf
gui, 2: show
return
|
The code works fine if I use gui, instead of gui, 2:
I assume there is a problem in GuiControl.
Has anybody an idea how to fix that?
Ideas and suggestions are very much appreciated!
schuerm |
|
| Back to top |
|
 |
etopsirhc
Joined: 12 Mar 2008 Posts: 32 Location: OR
|
Posted: Wed Sep 10, 2008 8:43 am Post subject: |
|
|
the only thing i can think of is try getting rid of the space between 2: and the other stuff
| Code: | | gui, 2:add, Tab2,w500, %tab_control% |
idk if thats the problem thoe *shrugs* |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Wed Sep 10, 2008 12:05 pm Post subject: |
|
|
| Have you tried the code after removing the spaces? If the code works without the 2... then there is something wrong with the 2. |
|
| Back to top |
|
 |
Hezzu
Joined: 08 Aug 2008 Posts: 50 Location: Raahe, Finland
|
Posted: Wed Sep 10, 2008 12:13 pm Post subject: |
|
|
| Code: |
tab_control = First Tab
gui 2: Add, Tab2,w500, %tab_control% ; Tab2 vs. Tab requires v1.0.47.05.
gui 2: Tab
gui 2: Add, Button, gogo, OK
gui 2: Show, ,my_tabs
return
ogo:
tab_control = %tab_control%|Second Tab
GuiControl,, SysTabControl321, %tab_control%
gui 2: tab, 2
gui 2: add, text,, adadsf
gui 2: show
return
|
works for me _________________
If you want the baby but not the labour pain PM me (simple things only please) |
|
| Back to top |
|
 |
Mustang
Joined: 17 May 2007 Posts: 415 Location: England
|
Posted: Thu Sep 11, 2008 3:51 am Post subject: |
|
|
I highlighted in red the bit you missed
| Code: | tab_control = First Tab
gui, 2: Add, Tab2,w500, %tab_control% ; Tab2 vs. Tab requires v1.0.47.05.
gui, 2: Tab
gui, 2: Add, Button, default xm gButtonOK, OK
gui, 2: Show, ,my_tabs
return
ButtonOK:
tab_control = %tab_control%|Second Tab
GuiControl,, SysTabControl321, |%tab_control% ; problem here???
gui, 2: tab, 2
gui, 2: add, text,, adadsf
gui, 2: show
return |
If you want to know the reason
On Gui1 the OK button defaults to label "ButtonOK"
But on Gui2 it defaults "Button1"
So you can either assign a g-label to the button (as I did above - also the preferred method)
Or change the label from "ButtonOK:" to "Button1:" |
|
| Back to top |
|
 |
schuerm
Joined: 26 Jul 2008 Posts: 7
|
Posted: Thu Sep 11, 2008 6:22 am Post subject: |
|
|
Thank you guys so much!!!!!
Michael |
|
| 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
|