namespace Yw.WinFrmUI { /// /// 用于右下角弹窗提示 /// public static class AlertToolHelper { // private static AlertControl Alert { get { if (_alert == null) { lock (_locker) { if (_alert == null) { _alert = new AlertControl(); _alert.AutoFormDelay = 3000; _alert.AutoHeight = false; _alert.FormMaxCount = 1; } } } return _alert; } } private static AlertControl _alert = null; private static object _locker = new(); /// /// 显示右下角弹窗 /// /// /// /// public static void ShowAlertInfo(this Form owner, string caption, string text) { AlertInfo info = new(caption, text); Alert.Show(owner, info); } /// /// 显示右下角弹窗 /// /// /// /// public static void ShowAlertInfo(this Control owner, string caption, string text) { var form = owner.FindForm(); form.ShowAlertInfo(caption, text); } } }