/// <summary> /// 打开一个消息提示对话框,并打开父窗体的遮罩层。 /// </summary> /// <param name="content">要显示的内容。</param> /// <param name="title">标题内容。</param> /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param> public static void ShowDialog(string content, string title = "提示", bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale) { var mbox = new PUMessageBox(title, content, false, showInTaskBar, animateStyle); if (!showInTaskBar) { mbox.ShowInTaskbar = false; } mbox.ShowDialog(); }
/// <summary> /// 打开一个消息确认对话框,并打开父窗体的遮罩层。 /// </summary> /// <param name="content">要显示的内容。</param> /// <param name="title">标题内容。</param> /// <param name="buttons">按钮内容,默认为“是/否”</param> /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param> public static bool?ShowConfirm(string content, string title = "提示", Buttons buttons = Buttons.YesOrNo, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale) { var mbox = new PUMessageBox(title, content, true, showInTaskBar, animateStyle); mbox.CheckButtonContent(buttons); if (!showInTaskBar) { mbox.ShowInTaskbar = false; } mbox.ShowDialog(); return(mbox.DialogResult); }
/// <summary> /// 打开一个消息确认对话框,并打开父窗体的遮罩层。 /// </summary> /// <param name="content">要显示的内容。</param> /// <param name="title">标题内容。</param> /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param> public static bool?ShowConfirm(string content, string title = "提示", Buttons buttons = Buttons.YesOrNo, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale) { var mbox = new PUMessageBox(title, content, true, showInTaskBar, animateStyle); switch (buttons) { case Buttons.YesOrNo: mbox.BtnYes.Content = "是"; mbox.BtnNo.Content = "否"; break; case Buttons.YesOrCancel: mbox.BtnYes.Content = "是"; mbox.BtnNo.Content = "取消"; break; case Buttons.OKOrCancel: mbox.BtnYes.Content = "确定"; mbox.BtnNo.Content = "取消"; break; case Buttons.AcceptOrRefused: mbox.BtnYes.Content = "接受"; mbox.BtnNo.Content = "拒绝"; break; case Buttons.AcceptOrCancel: mbox.BtnYes.Content = "接受"; mbox.BtnNo.Content = "取消"; break; } if (!showInTaskBar) { mbox.ShowInTaskbar = false; } mbox.ShowDialog(); return(mbox.DialogResult); }