类: using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; namespace DataGridViewPrinterApplication { class ResizeAction { bool IsMoving = false; int ctrlLastWidth = 0; int ctrlLastHeight = 0; int ctrlWidth; int ctrlHeight; int ctrlLeft; int ctrlTop; int cursorL; int cursorT; int ctrlLastLeft; int ctrlLastTop; int Htap; int Wtap; bool ctrlIsResizing = false; System.Drawing.Rectangle ctrlRectangle = new System.Drawing.Rectangle(); private Control ctrl; private Form frm; public ResizeAction(Control c, Form frm) { ctrl = c; this.frm = frm; this.Htap = this.frm.Height - this.frm.ClientRectangle.Height; this.Wtap = this.frm.Width - this.frm.ClientRectangle.Width; ctrl.MouseDown += new MouseEventHandler(MouseDown); ctrl.MouseMove += new MouseEventHandler(MouseMove); ctrl.MouseUp += new MouseEventHandler(MouseUp); } public void MouseMove(object sender, MouseEventArgs e) { if (frm == null) return; if (e.Button == MouseButtons.Left) { if (this.IsMoving)