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
625
UltraButton Query
posted

Hello team,

We are using Ultrawinbutton on the form, we want that the appearnce of the button should change when it gets the focus. We want the same functionality as we have for the toolbar button in the ribbon control. On mouse enter event the back color of the button changes to orange and on mouse leave event it is back to the original color.

For the ultraWinbutton we have set the button property UseHotTracking to True and tried changing the back color but it is not working.

Our query is how do we get that orange color at the background when the mouse enter event of that button is fired and how to set it to the button? 

 

  • 560
    Verified Answer
    posted

    I believe you have to turn off (False) 'UseOsThemes' property for the button. Then the Appearance.BackColor will come thru when set for HotTrackAppearance and UseHotTracking is set (True).

    • 625
      posted in reply to Brian

       Hi

      Have one more query, I m making the button style to "Office2007RibbonButton", the only problem is the button border is not the same as the  buttons on the Ribbon control.

      Do you know how do I change the button border to rounded for infragistics button (ultrabutton) ?

      • 625
        posted in reply to Matt Snyder

         Thanks Matt

        This is what i wanted..thanks once again

         

        • 37774
          Verified Answer
          posted in reply to april

          I believe that the Office2007RibbonButton was added as a style for the buttons on the ribbon itself to be able to resolve their styles differently by default.  There are no properties to automatically set the region of the button, however.  Fortunately, this is fairly straightforward to implement with the combination of a DrawFilter as well as setting the Region of the button:

           private class DF : IUIElementDrawFilter
          {

              #region IUIElementDrawFilter Members

              public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
              {
                  drawParams.DrawBorders(UIElementBorderStyle.Rounded3, Border3DSide.All);
                  return true;
              }

              public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams)
              {
                  if (drawParams.Element is UltraButtonUIElement)
                      return DrawPhase.BeforeDrawBorders;

                  return DrawPhase.None;
              }

              #endregion
          }

          this.ultraButton1.DrawFilter = new DF();
          this.ultraButton1.Region = DrawUtility.CreateBorderRegion(new Rectangle(Point.Empty, this.ultraButton1.Size), UIElementBorderStyle.Rounded3);

          -Matt

        • 625
          posted in reply to Brian

          Thank you very much for your reply..setting the UseOSTheme property to false did the trick..

           

          Thank you once again.