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 DevComponents.DotNetBar; namespace WCS { public partial class stndisplay : Office2007Form { Point formPoint;//记录窗体的位置 Point mousePoint; public stndisplay() { InitializeComponent(); //SetStyle(ControlStyles.UserPaint, true); //SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景. //SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲 } private void stndisplay_FormClosing(object sender, FormClosingEventArgs e) { Common.form1 = null; } private void form_MouseDown(object sender, MouseEventArgs e) { mousePoint = Control.MousePosition; formPoint = this.Location; } private void form_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Point mousePos = Control.MousePosition; this.Location = new Point(mousePos.X - mousePoint.X + formPoint.X, mousePos.Y - mousePoint.Y + formPoint.Y); } } private void close_Click(object sender, EventArgs e) { this.Close(); } private void stndisplay_Load(object sender, EventArgs e) { } } }