public Login() { InitializeComponent(); FormExIni(); _systemButtonManager = new SystemButtonManager(this); this.StartPosition = FormStartPosition.CenterScreen; }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Left) { SystemButtonManager.ProcessMouseOperate(e.Location, MouseOperate.Up); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (_systemButtonManager != null) { _systemButtonManager.Dispose(); _systemButtonManager = null; //_formBkg.Dispose(); //_formBkg = null; //_fringe.Dispose(); //_fringe = null; } } }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; //draw BackgroundImage // e.Graphics.DrawImage(_formBkg, ClientRectangle, new Rectangle(0, 0, _formBkg.Width, _formBkg.Height), GraphicsUnit.Pixel); //draw form main part // RenderHelper.DrawFromAlphaMainPart(this, e.Graphics); //draw system buttons SystemButtonManager.DrawSystemButtons(e.Graphics); //draw fringe // RenderHelper.DrawFormFringe(this, e.Graphics, _fringe, Radius); //draw icon if (Icon != null && ShowIcon) { e.Graphics.DrawIcon(Icon, IconRect); } //draw text if (Text.Length != 0) { TextRenderer.DrawText( e.Graphics, Text, Font, TextRect, Color.White, TextFormatFlags.SingleLine | TextFormatFlags.EndEllipsis); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); SystemButtonManager.ProcessMouseOperate(Point.Empty, MouseOperate.Leave); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); SystemButtonManager.ProcessMouseOperate(e.Location, MouseOperate.Move); }