基本信息
源码名称:c# 自定义控件透明,自定义透明窗体
源码大小:1.59KB
文件格式:.txt
开发语言:C#
更新时间:2016-05-10
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍
  1. private void InitializeComponent()  
  2. {  
  3.     this.label1 = new System.Windows.Forms.Label();  
  4.     this.SuspendLayout();  
  5.     //   
  6.     // label1  
  7.     //   
  8.     this.label1.AutoSize = true;  
  9.     this.label1.Location = new System.Drawing.Point(38, 26);  
  10.     this.label1.Name = "label1";  
  11.     this.label1.Size = new System.Drawing.Size(107, 12);  
  12.     this.label1.TabIndex = 0;  
  13.     this.label1.Text = "这个窗体是透明的!";  
  14.     //   
  15.     // Form1  
  16.     //   
  17.     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);  
  18.     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;  
  19.     this.BackColor = System.Drawing.Color.Red;                         //注意backColor的颜色要与TransparencyKey的颜色统一。  
  20.     this.ClientSize = new System.Drawing.Size(284, 261);  
  21.     this.Controls.Add(this.label1);  
  22.     this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(200)))), ((int)(((byte)(105)))));  
  23.     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;  
  24.     this.Name = "Form1";  
  25.     this.Text = "Form1";  
  26.     this.TransparencyKey = System.Drawing.Color.Red;                  //注意backColor的颜色要与TransparencyKey的颜色统一。      
  27.     this.Load  = new System.EventHandler(this.Form1_Load);  
  28.     this.Paint  = new System.Windows.Forms.PaintEventHandler(this.formMain_Paint);  
  29.     this.ResumeLayout(false);  
  30.     this.PerformLayout();