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
125
Change onmouseover / hover color on UltraStatusPanels of UltraStatusBar
posted

Continuation of http://www.infragistics.com/community/forums/p/108997/513245.aspx :

How do I change the mouseover / HotTrack color of those items?

Thanks in advance

Parents
No Data
Reply
  • 12480
    Offline posted

    Hello,

    Unlike the solution in the previous case, this cannot be done with a single property setting. UltraStatusPanels do not have hottracked appearance properties, nor does the UltraStatusPanel UI Role in AppStylist have a hot tracked state.

    The best way to accomplish this is to add some code to change the normal appearance properties based on the MouseEnterElement/MouseLeaveElement events. First, you'll need to disable the UseOSThemes property:

    ultraStatusBar1.UseOsThemes = DefaultableBoolean.False;

    If UseOSThemes is set to true, Windows has control of the drawing and it doesn't care about the IG appearance settings.

    Next, add some code to the aforementioned events:

    private void ultraStatusBar1_MouseEnterElement(object sender, UIElementEventArgs e)
    {
       if (e.Element is Infragistics.Win.UltraWinStatusBar.PanelUIElement)
       {
           UltraStatusPanel panel = e.Element.GetContext(typeof(UltraStatusPanel)) as UltraStatusPanel;
           panel.Appearance.BackColor = Color.Red;
       }
    }

    private void ultraStatusBar1_MouseLeaveElement(object sender, UIElementEventArgs e)
    {
       if (e.Element is Infragistics.Win.UltraWinStatusBar.PanelUIElement)
       {
           UltraStatusPanel panel = e.Element.GetContext(typeof(UltraStatusPanel)) as UltraStatusPanel;
           panel.Appearance.BackColor = Color.Empty;
       }
    }

    Please try this out and let me know whether it works.

Children
No Data