0

I have done a custom button using a Devexpress SimpleButton and I want to change the color of the button like this, but it doesn't work.

        this.Button.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
        this.Button.BackColor = Color.Pink;

I have done the same with the designer and it works fine, but now i want to do it programmatically and it's not working. Thanks in advance.

mrvinent
  • 115
  • 2
  • 16

1 Answers1

5

Make sure to set LookAndFeel.Style to Flat, Ultra Flat or Style3D:

this.Button.LookAndFeel.Style = LookAndFeelStyle.Flat;
this.Button.LookAndFeel.UseDefaultLookAndFeel = false;
this.Button.Appearance.BackColor = Color.MediumSeaGreen;
this.Button.Appearance.Options.UseBackColor = true;
abdul
  • 1,562
  • 1
  • 17
  • 22