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 

How to Select a Tab I Created in my Gui

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



Joined: 05 Aug 2006
Posts: 26

PostPosted: Thu Aug 28, 2008 10:11 pm    Post subject: How to Select a Tab I Created in my Gui Reply with quote

I have a Gui I created through AHK. It has a tab control in it.

When I click a button, I want the subroutine to be able to bring a certain tab to the front, thereby making it active.

How can I do that programatically?
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Fri Aug 29, 2008 12:36 am    Post subject: Reply with quote

By reading The Manual

GuiControl wrote:
GuiControl, Choose, ControlID, N: Sets the selection in a ListBox, DropDownList, ComboBox, or Tab control to be the Nth entry. N should be 1 for the first entry, 2 for the second, etc (if N is not an integer, the ChooseString method described below will be used instead). Unlike Control Choose, this sub-command will not trigger any g-label associated with the control unless N is preceded by a pipe character (even then, the g-label is triggered only when the new selection is different than the old one, at least for Tab controls). For example: GuiControl, Choose, MyListBox, |3.

To additionally cause a finishing event to occur (a double-click in the case of ListBox), include two leading pipes instead of one (this is not supported for Tab controls).

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
sugardaddy



Joined: 05 Aug 2006
Posts: 26

PostPosted: Fri Aug 29, 2008 8:54 pm    Post subject: Reply with quote

The manual is where I go first. I spent a lot of time scanning the Tab section, because that's where I thought it would be. I also thought I looked through GuiControl, because I've used that before. I must have missed it. Thanks.
Back to top
View user's profile Send private message
soggos



Joined: 27 Mar 2008
Posts: 37
Location: France

PostPosted: Tue Sep 02, 2008 4:11 pm    Post subject: ok but how to do when the gui is open or after gLabel? Reply with quote

ok very good with || or another gui delimiter like §§
when you run the gui
Code:

Gui, Add, Tab, Tab1§Tab2§§

but how to do if you want to select the tab after a gLabel
cause:
Code:
   GuiControl , Choose, Tab, §Tab2
;info: i have a Gui, +Delimiter§

don't work's!
How to do for select a Tab when the gui is already exist??
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Tue Sep 02, 2008 8:29 pm    Post subject: Reply with quote

Code:
GuiControl , Choose, Tab, §2
Question
_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Tue Sep 02, 2008 8:42 pm    Post subject: Re: ok but how to do when the gui is open or after gLabel? Reply with quote

soggos wrote:
How to do for select a Tab when the gui is already exist??


If you don't specify a variable for the Tab control then you should use its ClassNN instead:

Code:
gui, add, button, gdo
; gui, add, tab, vmytab, tab1|tab2|| ; use variable
gui, add, tab,, tab1|tab2||
gui show
return

do:
; guicontrol, choose, mytab, 1 ; uses the control's associated variable
guicontrol, choose, systabcontrol321, 1 ; uses the control classNN 
return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
soggos



Joined: 27 Mar 2008
Posts: 37
Location: France

PostPosted: Tue Sep 02, 2008 10:02 pm    Post subject: re Reply with quote

Quote:
GuiControl , Choose, Tab, §2

don't work's for me.
but that is ok:
Code:
GuiControl , Choose, systabcontrol321, 2

it's very Good

Merçi Smile à VOus!
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