public static void InitB2B() { b2bclient.Program.Main(null); b2bclient.Program.frmMsg += (str) => { MsgForm.ShowFrom(str); }; b2bclient.Program.frmMsgYesNo += (str) => { return(YesNoForm.ShowFrom(str)); }; }
//关闭时清理进程 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; } }
public static DialogResult ShowFrom(string text) { YesNoForm frm = new YesNoForm(text); return(frm.ShowDialog()); }