Jump to content

Change background color of a tab/tabitem control?


maqleod
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
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
Link to comment
Share on other sites

  • 1 year later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...