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?
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).
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) ?
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
Thanks Matt
This is what i wanted..thanks once again