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;
        }

 

posted @ 2020-05-18 16:49  逯文杰  阅读(1140)  评论(0编辑  收藏  举报