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 = "\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()); } } } }
个人主要研究:金融系统、MIS系统、人力资源管理系统、数据采集系统、权限管理系统等等系统。主攻C#开发语言,Oracle、Sql Server,WCF和Remoting通信。
如需联系可加QQ:442389681 Email:lxc880615@163.com 手机:18922735098
QQ群交流:186841119 (请注明来自博客园)
博客园地址:http://www.cnblogs.com/jara/ http://www.cnblogs.com/luoyuhao/
提示:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
如果觉得还有帮助的话,可以点一下右下角的【推荐】,希望能够持续的为大家带来好的技术文章!想跟我一起进步么?那就【关注】我吧。
如果对文章有任何问题,都可以在评论中留言,我会尽可能的答复您,谢谢您的阅读