image

變更Form1的FormBoarderStyle 屬性從“Sizable” 改成 “None”

打開Form1_Designer.cs加入下列

this.TransparencyKey = System.Drawing.SystemColors.Control;

   1: protected override void OnPaint(PaintEventArgs e)
   2: {
   3:     e.Graphics.DrawImage((Image)bmp, new Point(0, 0));
   4: }
   5: private void Form1_Load(object sender, EventArgs e)
   6: {
   7:     string sDir = System.IO.Directory.GetCurrentDirectory();
   8:     bmp = new Bitmap(sDir + "\\images.png");
   9:     bmp.MakeTransparent(Color.Blue);
  10: }

加入label, BackColor改成Transparent

   1: private void label1_Click(object sender, EventArgs e)
   2: {
   3:     Close();
   4: }

image

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 me1237guy 的頭像
    me1237guy

    天天向上

    me1237guy 發表在 痞客邦 留言(0) 人氣()