 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
sugardaddy
Joined: 05 Aug 2006 Posts: 26
|
Posted: Thu Aug 28, 2008 10:11 pm Post subject: How to Select a Tab I Created in my Gui |
|
|
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 |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Fri Aug 29, 2008 12:36 am Post subject: |
|
|
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 |
|
 |
sugardaddy
Joined: 05 Aug 2006 Posts: 26
|
Posted: Fri Aug 29, 2008 8:54 pm Post subject: |
|
|
| 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 |
|
 |
soggos
Joined: 27 Mar 2008 Posts: 37 Location: France
|
Posted: Tue Sep 02, 2008 4:11 pm Post subject: ok but how to do when the gui is open or after gLabel? |
|
|
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 |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Tue Sep 02, 2008 8:29 pm Post subject: |
|
|
| Code: | | GuiControl , Choose, Tab, §2 |  _________________ 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 |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Tue Sep 02, 2008 8:42 pm Post subject: Re: ok but how to do when the gui is open or after gLabel? |
|
|
| 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 |
|
 |
soggos
Joined: 27 Mar 2008 Posts: 37 Location: France
|
Posted: Tue Sep 02, 2008 10:02 pm Post subject: re |
|
|
| 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 à VOus! |
|
| 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
|