黑色 WinForms 按钮

发布于 2024-09-29 16:35:57 字数 176 浏览 1 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2024-10-06 16:35:57

FlatStyle 属性设置为 FlatStyle.Flat

您可以使用 FlatAppearance 属性进一步修改 L&F。

Set the FlatStyle property to FlatStyle.Flat.

You can use the FlatAppearance property to further modify the L&F.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文