Page 1 of 1

Tab name change

Posted: 06 Jun 2017, 15:57
by zcooler
Hello!

Did found out changing names on tabs are not entirely easy programmatically. Toralf did found a really simple method though many years ago, but it comes with a sideeffect which im wondering if its fixable. When the name change occurs it always skips to Tab1 and activates it, despite the Guicontrol Focus to prevent it. Any ideas how to stay on tab2 during whole name change?

Code: Select all

Gui,Add,Tab,vTabs,Hi|Hello 
Gui,Tab, 1
Gui,Tab, 2
Gui,Add,Edit,w200,Bug Here? 
Gui,Add,Edit,w200 vtyping gTypeHere,TypeHere 
Gui,Show 
Return 

TypeHere: 
   GuiControl, Text,Tabs,|Hi*|Hello*
   GuiControl, Focus, typing 
return

Re: Tab name change

Posted: 06 Jun 2017, 16:37
by A_AhkUser
GuiControl wrote: Param3 should contain a pipe-delimited list of entries to be appended at the end of the control's list. To replace (overwrite) the list instead, include a pipe as the first character (e.g. |Red|Green|Blue). To make the control empty, specify only a pipe character (|). To have one of the entries pre-selected, include two pipes after it (e.g. Red|Green||Blue).

Code: Select all

Gui,Add,Tab,vTabs,Hi|Hello 
Gui,Tab, 1
Gui,Tab, 2
Gui,Add,Edit,w200,Bug Here? 
Gui,Add,Edit,w200 vtyping gTypeHere,TypeHere 
Gui,Show 
Return 

TypeHere: 
   GuiControl, Text,Tabs,|Hi*|Hello*||
return

Re: Tab name change

Posted: 06 Jun 2017, 16:46
by zcooler
Phew...you saved me from a very time consuming rewrite! Many thanks A_AhkUser :)