//弹框确认是否有取消动作,并将弹框置于所有窗体上面//cancel return true. //showall TRUE时同时报警 public static bool MessageCancelTopMostYesNo(string str, bool activeAlarm, bool setSuspend, int ErrCode = 0, string hint = "提示") { //if (activeAlarm) //{ // RunA.showInfoAll(str.Replace("\n", "")); //} //if (setSuspend && Global.CVar.staRun.WI.stVar.bToRun) //{ // RunA.SetSuspend("弹框"); //} while (Global.WorkVar.TopMostFormShowing) { Thread.Sleep(30); } FormFlash.bConfirmYesNo = true; LogPopUpMsg("YesNo" + str); MessageBoxShowUI fm = new MessageBoxShowUI(str, hint, true, FormFlash.CONFIRM_YES_ON, activeAlarm, ErrCode); fm.ShowDialog(); if (Global.WorkVar.TopMostFormShowing == false && Global.WorkVar.TopMostFormChooseYes == false) { LogPopUpMsg("choose cancel"); return(true); } else { LogPopUpMsg("choose yes"); return(false); } }
// 将弹框置于所有窗体上面,无需选择 public static void MessageTopMost(string str, bool showAll, bool activeAlarm, bool setSuspend, int ErrCode = 0, string hint = "提示") { if (showAll) { } while (Global.WorkVar.TopMostFormShowing) { Thread.Sleep(30); } FormFlash.bConfirmYes = true; MessageBoxShowUI fm = new MessageBoxShowUI(str, hint, false, FormFlash.CONFIRM_YES, activeAlarm, ErrCode); fm.ShowDialog(); }