Button tab-like style Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Brazolek123
Posts: 175
Joined: 06 Jun 2016, 16:02

Button tab-like style

04 Jan 2017, 08:19

Hello. Look please at the screenshot of Gui I made:
Image

Is there any way I can make buttons here named as 'Client 1 and 2' to have style like tab that is above? (other method than make image-glabel-button that would look strange on different OS)
Or is it possible to have tab in tab? I know that there are some ways to make it but not sure if they support Tab3 style.

This is best what I've got so far:

Code: Select all

Gui, Add, Tab3,x20 y20 w300 h400, Main|Alarms|Settings|Advanced
Gui, Add, button, x22 y43 h22 -theme +0x8000,Client 1
Gui, Add, button, x68 y43 h22 -theme +0x8000,Client 2
Rami
Posts: 55
Joined: 19 May 2016, 07:44

Re: Button tab-like style

04 Jan 2017, 15:28

https://autohotkey.com/board/topic/7316 ... ntry733226
https://autohotkey.com/board/topic/7150 ... -sub-tabs/

Or :
without the theme the buttons have the same design as your tab3

Code: Select all

Gui, Add, button, x22 y43 h22 ,Client 1
Gui, Add, button, x68 y43 h22,Client 2
User avatar
Brazolek123
Posts: 175
Joined: 06 Jun 2016, 16:02

Re: Button tab-like style

04 Jan 2017, 19:54

I followed one of topics you've given, thanks for reply tho. Just changed standard 'tab' into 'tab3' control and there appeared some strange things, just look at gif. You guys know whats going on?

Image

Code: Select all

Gui, Add, Tab3, vTab2 x30 y65 w200 h200, Test3|Test4
Gui, Tab, 1
Gui, Add, Edit, , First on Second Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on Second Tab-Control
Gui, Add, Tab3, vTab1 gTab1 x5 y5 w300 h300, Test1|Test2
Gui, Tab, 1
Gui, Add, Edit, , First on First Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on First Tab-Control

Gui, Show
return

Tab1:
Gui, Submit, NoHide
if Tab1 = Test2
	GuiControl, Hide, Tab2
else
	GuiControl, Show, Tab2
WinSet, Redraw, , A
return

f12::
exitapp
Last edited by Brazolek123 on 05 Jan 2017, 04:46, edited 1 time in total.
tmplinshi
Posts: 1599
Joined: 01 Oct 2013, 14:57

Re: Button tab-like style  Topic is solved

05 Jan 2017, 01:59

Use Tab2 with +Theme option:

Code: Select all

Gui, Add, Tab3, vTab2 x30 y65 w200 h200, Test3|Test4
Gui, Tab, 1
Gui, Add, Edit, , First on Second Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on Second Tab-Control
Gui, Add, Tab2, +Theme vTab1 gTab1 x5 y5 w300 h300, Test1|Test2
Gui, Tab, 1
Gui, Add, Edit, , First on First Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on First Tab-Control

Gui, Show
return

Tab1:
Gui, Submit, NoHide
if Tab1 = Test2
	GuiControl, Hide, Tab2
else
	GuiControl, Show, Tab2
WinSet, Redraw, , A
return

f12::
exitapp
User avatar
Brazolek123
Posts: 175
Joined: 06 Jun 2016, 16:02

Re: Button tab-like style

12 Jan 2017, 14:32

Just small update, the code that is above need one little change - GuiControl, Hide will prevent user to interact with controls that are under the 'inside' tab. Moving control out of window would prevent it.

Maybe it would be helpful for someone, heres edited, full working code:

Code: Select all

 Gui, Add, Tab3, vTab2 x30 y65 w200 h200, Test3|Test4
Gui, Tab, 1
Gui, Add, Edit, , First on Second Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on Second Tab-Control
Gui, Add, Tab2, +Theme vTab1 gTab1 x5 y5 w300 h300, Test1|Test2
Gui, Tab, 1
Gui, Add, Edit, , First on First Tab-Control
Gui, Tab, 2
Gui, Add, Edit, , Second on First Tab-Control
Gui, Add, Checkbox, x60 y90, Testbox

Gui, Show
return

Tab1:
Gui, Submit, NoHide
if Tab1 = Test2     
	GuiControl, Move, tab2, x800 y800          ;move control to some cosmic location, same visual effect, working better
else
	GuiControl, Move, tab2, x30 y65
WinSet, Redraw, , A
return

f12::
exitapp

 

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, BeSu, Lee James, mikeyww, Odlanir, pizzapizze, Scrolllocko and 53 guests