Beispiel #1
0
        /// <summary>
        /// 控制box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void label_windowstool_Click(object sender, EventArgs e)
        {
            Label l = sender as Label;

            switch (l.Name)
            {
            case "label_min": { this.WindowState = FormWindowState.Minimized; } break;

            case "label_max":
            {
                if (this.WindowState == FormWindowState.Maximized)
                {
                    this.WindowState = FormWindowState.Normal;
                }
                else
                {
                    this.WindowState = FormWindowState.Maximized;
                }
            } break;

            case "label_menu": { cms_tools.Show(l, l.Left, l.Top + l.Height); } break;

            case "label_close":
            {
                var dr = new ZwMessageBox("确定关闭软件?").ShowDialog();
                if (dr == DialogResult.OK)
                {
                    this.Close();
                }
                break;
            }
            }
        }
Beispiel #2
0
        /// <summary>
        /// OK
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOK_Click(object sender, EventArgs e)
        {
            bool ck = true;

            foreach (var item in panelMain.Controls)
            {
                if (item.GetType().Name == "CheckTextBox")
                {
                    if (!((dynamic)item).ValueCheck)
                    {
                        ck = false;
                    }
                }
            }
            if (!ck)
            {
                ZwMessageBox.ShowMsg("输入错误!");
                return;
            }

            if (BtOk != null)
            {
                BtOk(null, null);
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
Beispiel #3
0
        public static void ShowMsg(string content)
        {
            ZwMessageBox mb = new ZwMessageBox(content);

            mb.ShowDialog();
        }