private void fMain_Paint(object sender, PaintEventArgs e) { if (GlassText.IsCompositionEnabled()) { e.Graphics.Clear(Color.Black); Rectangle clientArea = new Rectangle(0, pnlTop.Height, this.ClientRectangle.Width, this.ClientRectangle.Height - pnlTop.Height); Brush b = new SolidBrush(this.BackColor); e.Graphics.FillRectangle(b, clientArea); GlassText glasstxt = new GlassText(); glasstxt.FillBlackRegion(pnlTop.CreateGraphics(), pnlTop.ClientRectangle); glasstxt.DrawTextOnGlass(pnlTop.Handle, lblAppTitle.Text, lblAppTitle.Font, lblAppTitle.Bounds, 5); } }
public fMain() { InitializeComponent(); // Aero trick if (GlassText.IsCompositionEnabled()) { pnlTop.BackColor = Color.Black; lblAppTitle.Location = new Point(-5, -5); lblAppTitle.Visible = false; GlassText.MARGINS mg = new GlassText.MARGINS(); mg.m_Buttom = 0; mg.m_Left = 0; mg.m_Right = 0; mg.m_Top = pnlTop.Height; GlassText.DwmExtendFrameIntoClientArea(this.Handle, ref mg); } // MouseLeave trick ptOnWinTimer.Tick += new EventHandler(ptOnWinTimer_Tick); ptOnWinTimer.Interval = 50; //ptOnWinTimer.Enabled = true; }