dev右下角增加弹框提示信息

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using DevExpress.XtraBars.Alerter;
using DevExpress.XtraEditors;
 
namespace WindowsFormsApplication1
{
    public partial class Form2 : XtraForm
    {
        public Form2()
        {
            InitializeComponent();
        }
 
        private int alertheight = 0;
        delegate void DelegateShowAlert(string text);
 
        private void ShowAlertControl(string msg)
        {
            try
            {
                AlertControl alertControl1 = new AlertControl();
                alertControl1.AutoFormDelay = 10000;//弹框显示10秒
                //alertControl1.LookAndFeel.SkinName = "Office 2007 Blue";
                alertControl1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
                alertControl1.BeforeFormShow += new AlertFormEventHandler(alertControl1_BeforeFormShow);
                alertControl1.Show(null, "提示信息", msg, File.Exists(Application.StartupPath + "\\logo.ico") ? Image.FromFile(Application.StartupPath + "\\logo.ico") : null);
                alertControl1.BeforeFormShow -= new AlertFormEventHandler(alertControl1_BeforeFormShow);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "登录提示信息失败", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 
        private void alertControl1_BeforeFormShow(object sender, AlertFormEventArgs e)
        {
            e.AlertForm.Size = new Size(e.AlertForm.Size.Width + 50, 250 + alertheight);
        }
 
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //Thread.Sleep(10000);
            try
            {
                string msg = "\r\n本账号截止当前时间,您OA流程审批界面提醒如下:\r\n";
                msg += "\r\n" + "总共为" + ":0条记录没有审批,请及时处理!";
                msg += "\r\n详情请见:OA流程-OA审批流程记录";
 
                this.BeginInvoke(new DelegateShowAlert(ShowAlertControl), new object[] { msg });
                Thread.Sleep(1000);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, ex.GetType().ToString());
            }
        }
 
 
    }
}

  

posted @   Jara  阅读(2251)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 单线程的Redis速度为什么快?
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
历史上的今天:
2013-11-07 GridControl 史上最全的资料(一)
点击右上角即可分享
微信分享提示