private void OnMouseDown(object sender, MouseEventArgs e) { try { if (e.Location.Y <= (20) && e.Location.X > 50 && e.Location.X < (this.Width - 150)) { this.Cursor = Cursors.SizeAll; ControlHelper.MoveBorderless(this, e); base.OnMouseDown(e); this.Cursor = Cursors.Default; } } catch (Exception ex) { MessageBox.Show(MsgTxt.UnexpectedError + " IN Main2[OnMouseDown] Exception " + ex.ToString(), MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
////To Make Size Always Normal For Non-Grid Forms //protected override void OnResize(EventArgs e) //{ // if (this.WindowState == FormWindowState.Maximized) // { // // ControlHelper.SuspendDrawing(this); // this.SuspendLayout(); // this.WindowState = FormWindowState.Normal; // this.ResumeLayout(); // // ControlHelper.ResumeDrawing(this, false); // } //} protected override void OnMouseDown(MouseEventArgs e) { ControlHelper.MoveBorderless(this, e); }