ningshuxia
2025-04-16 ed113213fc94c3d9886ea08dfddd09d08d9ba7d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using DevExpress.XtraBars.Alerter;
 
namespace IStation.Win
{
    //用于右下角弹窗提示
    public class AlertTool
    {
        private static AlertControl Alert
        {
            get
            { 
                if (_alert == null)
                {
                    _alert = new AlertControl();
                    //_alert.FormMaxCount = 1;
                    _alert.AutoFormDelay = 2 * 1000;
                    _alert.AutoHeight = true;
                }
                return _alert;
            }
        }
        private static AlertControl _alert = null;
 
        /// <summary>
        /// 显示右下角弹窗
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="caption"></param>
        /// <param name="text"></param>
        public static void ShowInfo(Form owner, string caption, string text)
        {
            DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(caption, text); 
            AlertTool.Alert.Show(owner, info);
        }
 
 
    }
}