예제 #1
0
        //关闭时清理进程
        protected override void OnClosing(CancelEventArgs e)
        {
            YesNoForm frm = new YesNoForm("确定退出系统吗?");

            if (frm.ShowDialog() == DialogResult.Yes)
            {
                e.Cancel = false;

                Application.ExitThread();
                System.Environment.Exit(0);
            }
            else
            {
                e.Cancel = true;
            }
        }
예제 #2
0
        public static DialogResult ShowFrom(string text)
        {
            YesNoForm frm = new YesNoForm(text);

            return(frm.ShowDialog());
        }