• 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());
                }
            }
    
    
        }
    }
    

      

  • 相关阅读:
    CSS 3中细线边框如何实现?
    【SPL标准库专题(1)】 SPL简介
    【PSR规范专题(5)】PSR-4 改进后的自动加载规范
    【PSR规范专题(4)】PSR-3 日志接口规范
    【PSR规范专题(3)】PSR-2 代码风格规范
    【PSR规范专题(2)】PSR-1 基本代码规范
    YII框架的依赖注入容器与服务定位器简述
    PHP 反射机制Reflection
    【Apache运维基础(5)】Apache的Rewrite攻略(2)
    【Apache运维基础(4)】Apache的Rewrite攻略(1)
  • 原文地址:https://www.cnblogs.com/jara/p/7799873.html
Copyright © 2020-2023  润新知