Exemplo n.º 1
0
        //退出软件
        public void MenuFileExitOnClick(object o, EventArgs e)
        {
            if (isSaved)
            {
                System.Environment.Exit(0);
            }
            else
            {
                isSavedDialog = new SimpleDialogBox();
                isSavedDialog.StartPosition = FormStartPosition.CenterParent;
                String tip = "您是否要将改变的内容保存到" + openedFilePath + "文件中?";
                isSavedDialog.SaveTextBtnDialog(tip);

                isSavedDialog.ShowDialog();
            }
        }
Exemplo n.º 2
0
        public void MenuFileAboutOnClick(object o, EventArgs e)
        {
            SimpleDialogBox simpleDialogBox = new SimpleDialogBox();

            //初始化对话框信息
            simpleDialogBox.SetText("关于");
            simpleDialogBox.SetSize(new Size(200, 100));
            simpleDialogBox.SetMinimizeBox(false);
            simpleDialogBox.SetMaximizeBox(false);
            simpleDialogBox.SetControlBox(true);
            simpleDialogBox.SetShowInTaskbar(false);
            simpleDialogBox.SetFormBorderStyle(FormBorderStyle.Fixed3D);

            //相对于父亲窗口居中
            simpleDialogBox.StartPosition = FormStartPosition.CenterParent;

            //生成版本信息
            simpleDialogBox.AboutLabelDialog();

            //显示对话框
            simpleDialogBox.ShowDialog();
        }