I am trying to style a ButtonUIElement like this:
ButtonUIElement elementToAdd = new ButtonUIElement(parent);
elementToAdd.BorderStyle = UIElementBorderStyle.Raised;
but I get a "specificed method is not supported".
I also created a new Appearance object and styled the border and made the button's appearance use this object but I see no effects.
When I create a new ButtonUIElement, it's a flat grey rectangle. How can I make it look like a real button?
I must be missing something here Mike. If I create a class which inherits ButtonUIElement and then I try to override the ButtonStyle property so that it is both readable and writable then I get a compiler error stating "'Public Overrides Property ButtonStyle() As Infragistics.Win.UIElementButtonStyle' cannot override 'Public Overridable ReadOnly Property ButtonStyle() As Infragistics.Win.UIElementButtonStyle' because they differ by 'ReadOnly' or 'WriteOnly'".
You have to override it on your derived element class.
Hi Mike. None of this makes sense as no matter whether you use either of a DrawFilter or a derived class, the ButtonStyle property of the ButtonUIElement class is readonly. Therefore how can you change it?
You might also have to override BorderStyle and/or BorderSides on the element.
Thanks. My button is using the class below and I still see no borders.
internal class MyButtonUIElement : ButtonUIElement { public MyButtonUIElement(UIElement parent) : base(parent) { } protected override void InitAppearance(ref AppearanceData appearance, ref AppearancePropFlags requestedProps) { base.InitAppearance(ref appearance, ref requestedProps); appearance.BorderColor = Color.Red; appearance.BackColor2 = Color.DarkSeaGreen; } }