C#自定义SimpleButton更改颜色
问题描述:
我已经使用Devexpress SimpleButton完成了一个自定义按钮,并且我想要像这样更改按钮的颜色,但它不起作用。C#自定义SimpleButton更改颜色
this.Button.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
this.Button.BackColor = Color.Pink;
我已经做了与设计师一样,它工作正常,但现在我想以编程方式做到这一点,它不工作。提前致谢。
答
务必将LookAndFeel.Style
平淡,超平或Style3D:
this.Button.LookAndFeel.Style = LookAndFeelStyle.Flat;
this.Button.LookAndFeel.UseDefaultLookAndFeel = false;
this.Button.Appearance.BackColor = Color.MediumSeaGreen;
this.Button.Appearance.Options.UseBackColor = true;
这工作完全正常,谢谢! – mrvinent