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
685
Group Header Color
posted

I'm trying to manually style my explorer bar groups.  However, I'm finding that there aren't individual group settings.  I want each group header to be a different color.  I can't seem to make that happen.

I've tried in AppStylist but everything I do is applied to every group.  I've used sub-styles based on the original style. However, whenever I apply the sub-style, it applies it to all the group headers.

I've even turned off the styles completely so I could rely solely on the control styles I code to prevent any contention between them.  

I've used both Appearance, and HeaderAppearance.

arMain.Groups.Add(grpMB);

grpMB.Settings.AppearancesLarge.Appearance.BackColor = Color.Purple;

Is it possible to have separate colors for each group header?

  • 28925
    Offline posted

    Hello Sean,

    Since AppStylelist is not associated with any data or groups at runtime, the most you can do there is style presets. Many of the local group appearance related settings will need to be applied at runtime.

    The UltraExplorerBarGroupAppearances object has several properties that return an Appearance object. The Appearance object (part of the Infragistics.Win assembly has properties that specify formatting attributes, such as foreground color, background color, transparency, etc. The GroupAppearances object access these Appearance objects through properties that indicate what the Appearance is used for. ActiveAppearance returns the appearance applied to the Items in the Group when they become active. EditAppearance supplies the settings for Group Items that are being edited, and the Appearance supplies the default non-active, non-editing appearance settings.

    There are also Appearance objects used to format the Group itself, such as ActiveHeaderAppearance which controls the look of the Group's header when the Group is active, and HeaderAppearance, which applies to the Group's header when the Group is not active.

    eg.

    group.Settings.AppearancesSmall.ActiveHeaderAppearance.BackColor
    group.Settings.AppearancesLarge.ActiveHeaderAppearance.BackColor
    
    group.Settings.AppearancesSmall.HeaderAppearance.BackColor
    group.Settings.AppearancesLarge.HeaderAppearance.BackColor

    If these properties don't take affect then the OS might be suppressing them. In that case, you can suppress the OS theme by setting the UseOsThemes property to False on the explorer bar.

    this.ultraExplorerBar1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;

    Let me know if you have any questions.