zoukankan      html  css  js  c++  java
  • dev右下角增加弹框提示信息

    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 = "
    本账号截止当前时间,您OA流程审批界面提醒如下:
    ";
                    msg += "
    " + "总共为" + ":0条记录没有审批,请及时处理!";
                    msg += "
    详情请见:OA流程-OA审批流程记录";
    
                    this.BeginInvoke(new DelegateShowAlert(ShowAlertControl), new object[] { msg });
                    Thread.Sleep(1000);
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message, ex.GetType().ToString());
                }
            }
    
    
        }
    }
    

      

  • 相关阅读:
    (C/C++学习笔记) 五. 常变量(只读变量)和宏
    (C/C++学习笔记) 四. 运算符
    (C/C++学习笔记) 三. 作用域和可见性
    (C/C++学习笔记) 一. 基础知识
    计算机科学的基本术语及其英语表达
    模块与包
    Python的递归
    内置函数与匿名函数
    装饰器,迭代器,生成器分析
    命名关键字参数,函数对象,嵌套,名称空间与作用域,闭包
  • 原文地址:https://www.cnblogs.com/jara/p/7799873.html
Copyright © 2011-2022 走看看