Jump to content

Recommended Posts

Posted

Hi!

I can't seem to color tab controls. The included code creates a GUI with a tabItems in a Tab control, and a label on the tabItem. I gave every element some color command. The total GUI colors can be set, as can the label colors, but for a tab and tabItem control I cannot set any color. Am I missing something here?

Furthermore, why do these two color commands need their parameters in reverse order?

GUISetBkColor(<color>,<handle>)

GUICtrlSetColor(<handle>,<color>)

Example code:

$gui = GUICreate("test",500,200)
$tab = GUICtrlCreateTab(10,10,400,180)
$tab1 = GUICtrlCreateTabItem("test 1")
$label = GUICtrlCreateLabel("White on black",20,50,300,50)
GUICtrlCreateTabItem("")

GUISetBkColor(0x005555,$gui)
GUICtrlSetBkColor($tab,0x555500)
GUICtrlSetColor($tab,0x550055)
GUICtrlSetBkColor($tab1,0xBBBB00)
GUICtrlSetBkColor($label,0x000000)
GUICtrlSetColor($label,0xFFFFFF)

GUISetState()

MsgBox(0,"test","See what I mean?")

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Posted

BTW The help for the color command tells us that some control types can be controlled, but not all. Tab is not in the list. So I guess there isn't a way in this command. But would anyone know any other way?

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Posted

BTW The help for the color command tells us that some control types can be controlled, but not all. Tab is not in the list. So I guess there isn't a way in this command. But would anyone know any other way?

You could probably use the Win API to send the proper 'msg' to the control. Sorry, I can't come up with the code off the top of my head.

Ralph

Posted

You could probably use the Win API to send the proper 'msg' to the control. Sorry, I can't come up with the code off the top of my head.

Ralph

Thanks anyway... I'm afraid that I can't get around diving into all that COM API stuff any longer :whistle:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

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
×
×
  • Create New...