LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Change tab background color

How it possible to change individual tab background color

Thanks

0 Kudos
Message 1 of 5
(4,012 Views)

The tab page background color can be assigned either in the UIR editor with the paint tool (the button with the little brush) or programmatically with SetTabPageAttribute (panelHandle, controlID, tabIndex, ATTR_BACKCOLOR, xxx); either passing a predefined color (e.g. VAL_PANEL_GRAY) or embedding the appropriate MakeColor () in the function.

Pay attention that you won't be able to change the background color if you have the Conform to system color or Use windows visual styles for controls panel options enabled.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(4,010 Views)
What Roberto said, but in addition, if you have converted your tab to a
panel (with GetPanelHandleFromTabPage, which is something I almost always do
for the added functionalities), I'm pretty sure you can simply use
SetPanelAttribute (, ATTR_BACKCOLOR, );
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 3 of 5
(3,979 Views)

Hi I have similar problem but in a different case:

I use windows 9.0 on windows 7 and use panel and my program is opened in 'Windows Style' on windows 7.

I don't want to change it to old apperance on Windows XP,  since new version looks god, but when I add 

a tab onto a panel in my program, it comes with white background color. and, trying to paint its background color

requires cancellation of windows style according to popup message appeared. Isn't it possible to change tab

background color in windows style.

 

 

thanks for any help.

0 Kudos
Message 4 of 5
(3,937 Views)

In short, there is no way of changing the tab aspect if you have the 'Use windows visual style for controls" panel attribute set.

Given this, I can see 2 possible alternatives: you can programmatically reset that attribute for the single tab using SetCtrlAttribute with ATTR_DISABLE_PANEL_THEME attribute: the tab will be shown in "classic" style while the other controls will continue following the desktop theme; you can move tabs on the bottom or side border of the tab: this switches the tab from white color to window frame color; you can test this in the UIR editor. You won't be able to change assigned color in this case too.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 5
(3,928 Views)