C#透明按钮设置
完全透明的按钮,只在鼠标经过时显示边框线。
属性Button.Image设置图片按钮,可与背景完美结合。
public void setButtonStyle(Button btn)
{
btn.ForeColor = Color.Transparent;
btn.BackColor = Color.Transparent;
btn.FlatStyle = FlatStyle.Flat;
btn.FlatAppearance.BorderSize = 0;
btn.FlatAppearance.MouseOverBackColor = Color.Transparent;
btn.FlatAppearance.MouseDownBackColor = Color.Transparent;
}