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 

add a tab in gui, 2

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



Joined: 26 Jul 2008
Posts: 7

PostPosted: Wed Sep 10, 2008 8:35 am    Post subject: add a tab in gui, 2 Reply with quote

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 Sad

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



Joined: 12 Mar 2008
Posts: 32
Location: OR

PostPosted: Wed Sep 10, 2008 8:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Wed Sep 10, 2008 12:05 pm    Post subject: Reply with quote

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



Joined: 08 Aug 2008
Posts: 50
Location: Raahe, Finland

PostPosted: Wed Sep 10, 2008 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mustang



Joined: 17 May 2007
Posts: 415
Location: England

PostPosted: Thu Sep 11, 2008 3:51 am    Post subject: Reply with quote

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



Joined: 26 Jul 2008
Posts: 7

PostPosted: Thu Sep 11, 2008 6:22 am    Post subject: Reply with quote

Thank you guys so much!!!!!

Michael
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