无法更改按钮的整个背景颜色

问题描述 投票:0回答:4

我无法更改按钮的整个背景颜色。我在属性中更改它。

有人知道如何解决这个问题吗?

Klick this link to see a picture of this problem

c# winforms button background
4个回答
4
投票

更改突出显示的属性:

enter image description here

它会给你一个像这样的按钮(我的是红色的):

enter image description here


0
投票

您应该设置属性组合:

this.button1.BackColor = System.Drawing.Color.Red;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.UseVisualStyleBackColor = false;

你会得到这个:

enter image description here


0
投票

那是因为按钮的扁平风格, 将 FlatStyle 更改为 Flat,

并在 FlatAppearence 中将 BorderSize 更改为 0 以消除边框

enter image description here


0
投票

然后没有边界半径,不再平滑了

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.