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语言编写生成小学四则运算程序
    每周学习报告
    读现代软件工程有感和自我介绍
    第七天
    第五天
    第六天
    作业九:课程总结
    作业四:结对编程项目--四则运算
    psp记录个人项目花费时间
    作业三:代码规范,代码复查
  • 原文地址:https://www.cnblogs.com/jara/p/7799873.html
Copyright © 2011-2022 走看看