.NET創建winform透明窗體

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace winform
{
     public partial class Form1 : Form
     {
         public Form1()
         {

             this.Location = new Point(100, 100);
             this.Cursor = System.Windows.Forms.Cursors.Hand;// 定義在窗體上,光標顯示爲手形
             this.Text = "透明窗體";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;// 定義窗體的開始顯示位置是屏幕的中間
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
             this.ForeColor = System.Drawing.SystemColors.Desktop;
             this.Font = new System.Drawing.Font("宋體", 9);
             this.BackColor = System.Drawing.Color.Blue;
             this.ClientSize = new Size(440, 170);

             this.Opacity = 0.1;
         }

         public static void Main()
         {
             Application.Run(new Form1());
         }
     }
}

發佈了56 篇原創文章 · 獲贊 24 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章