今天开发登陆界面时,遇到一个窗体控制设置问题:
1、将按纽设置为透明;
2、并且使用背景图片的颜色;
3、并且需要当点击这个按纽时,仍然显示背景图片颜色;
4、去掉按纽边框显示线;
需要的效果如下:
将按纽托动到窗体图片位置后,WinForm中做如下控件属性设置即可:
this.btnLogin.BackColor = Color.Transparent; this.btnLogin.FlatStyle = FlatStyle.Flat; this.btnLogin.FlatAppearance.BorderSize = 0; this.btnLogin.FlatAppearance.MouseOverBackColor = Color.Transparent; this.btnLogin.FlatAppearance.MouseDownBackColor = Color.Transparent; this.btnLogin.Text = "";
时间: 2024-11-07 07:09:48