Thursday, May 26, 2011

CSharp Form With Aero Glass


Simple Form With Aero Glass Effect

THE CODE


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern void DwmExtendFrameIntoClientArea(
            IntPtr hWnd, MARGINS pMargins);

        [StructLayout(LayoutKind.Sequential)]
        public class MARGINS
        {
            public int cxLeftWidth, cxRightWidth,
                       cyTopHeight, cyBottomHeight;
        }

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.BackColor = Color.Black;
            MARGINS m = new MARGINS();
            m.cxLeftWidth = -1;
            m.cxRightWidth = -1;
            m.cyBottomHeight = -1;
            m.cyTopHeight = -1;
            //set all value -1 to apply glass effect to the all of visible window
            DwmExtendFrameIntoClientArea(this.Handle, m);

        }
    }
}

1 comment:

  1. There are many other sinus infections signs and symptoms and it
    is not only bacterial or viral. The vaccine is offered in a 3 shot interval over a six thirty day period time body.


    Feel free to visit my website: home std testing kits

    ReplyDelete