I want to make the color of a tab change on a certain event. The ISL file for the project contains the following:
<styleLibrary> <styleSets defaultStyleSet="Default"> <styleSet name="Default" viewStyle="Standard"> ... <styles> ... <style role="TabItem"> <states> <state name="Normal"> <resources> <name>Header</name> </resources> </state> <state name="HotTracked"> <resources> <name>HeaderHotTrack</name> </resources> </state> <state name="Active"> <resources> <name>HeaderActive</name> </resources> </state> ... </states> </style> </styles> </styleSet> <resources> ... <resource name="Header" backColor="White" foreColor="Black" backColor2="255, 152, 53" backGradientStyle="Vertical" /> <resource name="HeaderActive" backColor="255, 237,175" foreColor="Black" backColor2="255, 127, 0" backGradientStyle="Vertical" /> <resource name="HeaderHotTrack" backColor="25, 237, 175" foreColor="White" backColor2="255,127, 0" backGradientStyle="Vertical" /> <resource name="HeaderHasUpdates" backColor="Green" foreColor="Black" backColor2="White" backGradientStyle="Vertical" /> ... </resources> </styleLibrary> When the program begins, it is loaded with:
Infragistics.Win.AppStyling.StyleManager.Load(<filefullname>)
When the tab is selected, the tab is colored as the resource named "HeaderActive". At a certain trigger, I want it to be switched to the resource named "HeaderHasUpdates." What I currently have which isn't working is this (where mdiTab is an Infragistics.Win.UltraWinTabbedMdi.MdiTab):
mdiTab.Settings.TabAppearance.StyleResourceName = "HeaderHasUpdates"
If I remove all of the resources except the "HeaderHasUpdates" one, the forecolor actually does change, which makes me think there's another place where the colors are being set and at that spot, the foreColor isn't being set. I'm just unfamiliar with the precedence of color styles.
So what can I do to change the style?
Hello,
I believe that this depends on the 'ResolutionOrder' property. You could read about it at:
http://help.infragistics.com/NetAdvantage/WinForms/2011.2/CLR2.0/?page=Infragistics2.Win.v11.2~Infragistics.Win.AppStyling.ResolutionOrder.html.
This should give you an overview of the precedence of the appearance.
So please try using some of the Memebers of the above Enumeration depending on your needs and let me know if you need additional assistance or if you feel that I misunderstood you.