Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
How can I change the color of an mdiTab that already has a style assigned to it?
posted

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?

Parents
No Data
Reply Children
No Data