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?
Hi, rdeslonde.
I have read your post. And I have applied your code in my program. but your code doesn't not work.
Why doesn't your code work in my program? Is there any code that I write any more?
public class CButtomUIElementEx : Infragistics.Win.ButtonUIElement
{ private UIElementButtonStyle buttonStyle = UIElementButtonStyle.OfficeXPToolbarButton;
public UIElementButtonStyle StyleOfButton { get { return buttonStyle; } set { buttonStyle = value; } }
public override UIElementButtonStyle ButtonStyle {
get { return buttonStyle; } }
public CButtomUIElementEx(UIElement parent) : base(parent) { }
}
Here it is in C#.
class MyButtonUIElement : ButtonUIElement
{
get{ return buttonStyle; }}
public EMISButtonUIElement(UIElement parent): base (parent)
Hi abukres,
I too face the same issue with ButtonUIelement. It would be grateful, if you could help me to fix this issue.
Regards,
Anandhavel.J
Hi Tonic2012,
I am facing the same issue with ButtonUIElement styling using Creationfilters and Drawfilters. Can you shed some light on me to fix this issue.
I am working on a c# win application. My form is already derived form "Form" class and we have implemented 2 interfaces. So, i couldn't derive the ButtonUIElement for my class as stated in the thread.
Sample:
public partial class RowExpForm : Form, IUIElementCreationFilter, IUIElementDrawFilter
Please help me how to override the buttonstyle and borderstyle property.
Waiting for your favorable reply.
Actually, I've worked it out now (d'oh). You override the property as readonly and you expose the ability to change the ButtonStyle through a different property or method. For example:
Imports Infragistics.WinImports Infragistics.Win.UltraWinGrid
Public Class TimeEntryNavButton Inherits ButtonUIElement
Public Property StyleOfButton() As Infragistics.Win.UIElementButtonStyle Get Return _ButtonStyle End Get Set(ByVal value As Infragistics.Win.UIElementButtonStyle) _ButtonStyle = value End Set End Property
Public Overrides ReadOnly Property ButtonStyle() As Infragistics.Win.UIElementButtonStyle Get Return _ButtonStyle End Get End Property
End Class