黑色 WinForms 按钮
在 WinForms 应用程序中添加带有白色文本的黑色按钮的最直接方法是什么?只需将 BackColor 设置为黑色,将 ForeColor 设置为白色,按钮边框就会像以前一样保持不变。
我是否需要子类化 System.Windows.Forms.Button 类并控制 OnPaint() 绘图?
谢谢。
What is the most straightforward way to add a black button with white text in a WinForms Application? Simply setting the BackColor to black and the ForeColor to white the button border remains as before.
Do I need to subclass the System.Windows.Forms.Button class and take control of the OnPaint() drawing?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
FlatStyle
属性设置为FlatStyle.Flat
。您可以使用
FlatAppearance
属性进一步修改 L&F。Set the
FlatStyle
property toFlatStyle.Flat
.You can use the
FlatAppearance
property to further modify the L&F.