C# 实现透明可移动窗体

1、设置窗体属性

this.BackColor
this.TransparencyKey = this.BackColor;

2、窗体加载图片

this.BackgroundImage = global::TransParentForm.Properties.Resources.FormBackGroup;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;

3、重写窗体鼠标事件

this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Frm_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Frm_MouseMove);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Frm_MouseUp);

4、添加控件,大功造成!

5、源码下载地址:

https://download.csdn.net/download/xgllrp003/10377949

posted on 2018-04-27 10:36  strangeman  阅读(503)  评论(0编辑  收藏  举报

导航