using System; using System.Drawing; using System.Windows.Forms; namespace CompressorXN.Untils { public partial class FrmDialog : Form { /// /// 消息弹框 /// /// 消息内容 /// 弹框标题 public FrmDialog(string content, string title = "系统提示") { InitializeComponent(); this.TopLevel = true; lbl_Title.Text = title; lbl_Content.Text = content; } /// /// 点击确定按钮 /// /// /// private void btn_Sure_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; } #region 无边框拖动 private void Panel_MouseDown(object sender, MouseEventArgs e) { mPoint = new Point(e.X, e.Y); } private void Panel_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.Location = new Point(this.Location.X + e.X - mPoint.X, this.Location.Y + e.Y - mPoint.Y); } } private Point mPoint; #endregion } }