码迷,mamicode.com
首页 > Windows程序 > 详细

C# WinForm 设置按纽为透明,使用背景色

时间:2015-09-21 21:18:23      阅读:674      评论:0      收藏:0      [点我收藏+]

标签:

 

今天开发登陆界面时,遇到一个窗体控制设置问题:

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 = "";

 

C# WinForm 设置按纽为透明,使用背景色

标签:

原文地址:http://www.cnblogs.com/sandyliu1999/p/4827077.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!