基本信息
源码名称:c# 自定义控件透明,自定义透明窗体
源码大小:1.59KB
文件格式:.txt
开发语言:C#
更新时间:2016-05-10
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(38, 26);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(107, 12);
- this.label1.TabIndex = 0;
- this.label1.Text = "这个窗体是透明的!";
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.Red; //注意backColor的颜色要与TransparencyKey的颜色统一。
- this.ClientSize = new System.Drawing.Size(284, 261);
- this.Controls.Add(this.label1);
- this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105)))));
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Name = "Form1";
- this.Text = "Form1";
- this.TransparencyKey = System.Drawing.Color.Red; //注意backColor的颜色要与TransparencyKey的颜色统一。
- this.Load = new System.EventHandler(this.Form1_Load);
- this.Paint = new System.Windows.Forms.PaintEventHandler(this.formMain_Paint);
- this.ResumeLayout(false);
- this.PerformLayout();
-
}