Sign in to follow this  
Followers 0
maqleod

Change background color of a tab/tabitem control?

5 posts in this topic

my gui has a background color set, I want the color inside the tab box to match it, but all I get is the default

here is my code for the tab/tabitem control:

Opt("GUICoordMode",0)

$tab = GUICtrlCreateTab(10, 10, 195, 175)

GUICtrlSetBkColor(-1,$background[1][1])

$tab1 = GUICtrlCreateTabItem("Apps")

GUICtrlSetState(-1, $GUI_DEFBUTTON)

$but1 = GUICtrlCreateButton ("1", 32, 40, 32, 32,$BS_ICON)

GUICtrlSetImage (-1, $but1opt1[2][1])

any help would be appreciated


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites



my gui has a background color set, I want the color inside the tab box to match it, but all I get is the default

here is my code for the tab/tabitem control:

Opt("GUICoordMode",0)

$tab = GUICtrlCreateTab(10, 10, 195, 175)

GUICtrlSetBkColor(-1,$background[1][1])

$tab1 = GUICtrlCreateTabItem("Apps")

GUICtrlSetState(-1, $GUI_DEFBUTTON)

$but1 = GUICtrlCreateButton ("1", 32, 40, 32, 32,$BS_ICON)

GUICtrlSetImage (-1, $but1opt1[2][1])

any help would be appreciated

Hello,

Found in AutoIT help file, GUICtrlSetColorFunction Reference ->>

Remarks

Only Label and Progress controls can currently be colored.

Share this post


Link to post
Share on other sites

you can add a label to the tab item and make it the size of the tab item's client area. get the handle to the label using ControlGetHandle() , then make a child window the exact same size and position as the label, use the handle for the label as the last parameter in GuiCreate().

you can then set the background color of the child window as you wish and continue adding controls to that child window.

it's a pain, but it works.....also how I make "Nested" tabs....


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

about GUICtrlSetColor: the beta is doing a wider job see doc

Only Label, Checkox, Group, Radio, Edit, Input, Listview, Treeview, Graphic and Progress controls can currently be colored.

;)

Share this post


Link to post
Share on other sites

Could you show some code for this method?

When i tried it on the first of two tabs, the second tab would not show up and the background color would not show.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0