1. namespace DevExpress.Utils
  2. {
  3. using DevExpress.LookAndFeel;
  4. using DevExpress.Skins;
  5. using DevExpress.Utils.Drawing;
  6. using DevExpress.XtraEditors;
  7. using System;
  8. using System.ComponentModel;
  9. using System.Drawing;
  10. using System.Reflection;
  11. using System.Windows.Forms;
  12. public class WaitDialogForm : XtraForm
  13. {
  14. private Font boldFont;
  15. private string caption;
  16. private Font font;
  17. private PictureBox pic;
  18. private string title;
  19. public WaitDialogForm() : this("")
  20. {
  21. }
  22. public WaitDialogForm(string caption) : this(caption, "")
  23. {
  24. }
  25. public WaitDialogForm(string caption, Size size) : this(caption, "", size, null)
  26. {
  27. }
  28. public WaitDialogForm(string caption, string title) : this(caption, title, new Size(260, 50), null)
  29. {
  30. }
  31. public WaitDialogForm(string caption, string title, Size size) : this(caption, title, size, null)
  32. {
  33. }
  34. public WaitDialogForm(string caption, string title, Size size, Form parent)
  35. {
  36. this.caption = "";
  37. this.title = "";
  38. this.boldFont = new Font("Arial", 9f, FontStyle.Bold);
  39. this.font = new Font("Arial", 9f);
  40. this.caption = caption;
  41. this.title = (title == "") ? "Loading Data. Please Wait." : title;
  42. this.pic = new PictureBox();
  43. base.FormBorderStyle = FormBorderStyle.FixedDialog;
  44. base.ControlBox = false;
  45. base.ClientSize = size;
  46. if (parent == null)
  47. {
  48. base.StartPosition = FormStartPosition.CenterScreen;
  49. }
  50. else
  51. {
  52. base.StartPosition = FormStartPosition.Manual;
  53. base.Left = parent.Left + ((parent.Width - base.Width) / 2);
  54. base.Top = parent.Top + ((parent.Height - base.Height) / 2);
  55. }
  56. base.ShowInTaskbar = false;
  57. base.TopMost = true;
  58. base.Paint += new PaintEventHandler(this.WaitDialogPaint);
  59. this.pic.Size = new Size(0x10, 0x10);
  60. this.pic.Location = new Point(8, (base.ClientSize.Height / 2) - 0x10);
  61. this.pic.Image = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("DevExpress.Utils.wait.gif"));
  62. base.Controls.Add(this.pic);
  63. base.Show();
  64. this.Refresh();
  65. }
  66. public string GetCaption()
  67. {
  68. return this.Caption;
  69. }
  70. protected override void OnClosing(CancelEventArgs e)
  71. {
  72. this.pic.Image = null;
  73. this.boldFont = null;
  74. this.font = null;
  75. base.OnClosing(e);
  76. }
  77. public void SetCaption(string newCaption)
  78. {
  79. this.Caption = newCaption;
  80. }
  81. private void WaitDialogPaint(object sender, PaintEventArgs e)
  82. {
  83. Rectangle clipRectangle = e.ClipRectangle;
  84. clipRectangle.Inflate(-1, -1);
  85. GraphicsCache cache = new GraphicsCache(e);
  86. using (StringFormat format = new StringFormat())
  87. {
  88. Brush solidBrush = cache.GetSolidBrush(LookAndFeelHelper.GetSystemColor(base.LookAndFeel, SystemColors.WindowText));
  89. format.Alignment = format.LineAlignment = StringAlignment.Center;
  90. format.Trimming = StringTrimming.EllipsisCharacter;
  91. if (base.LookAndFeel.ActiveLookAndFeel.ActiveStyle == ActiveLookAndFeelStyle.Skin)
  92. {
  93. ObjectPainter.DrawObject(cache, new SkinTextBorderPainter(base.LookAndFeel), new BorderObjectInfoArgs(null, clipRectangle, null));
  94. }
  95. else
  96. {
  97. ControlPaint.DrawBorder3D(e.Graphics, clipRectangle, Border3DStyle.RaisedInner);
  98. }
  99. clipRectangle.X += 30;
  100. clipRectangle.Width -= 30;
  101. clipRectangle.Height /= 3;
  102. clipRectangle.Y += clipRectangle.Height / 2;
  103. e.Graphics.DrawString(this.title, this.boldFont, solidBrush, clipRectangle, format);
  104. clipRectangle.Y += clipRectangle.Height;
  105. e.Graphics.DrawString(this.caption, this.font, solidBrush, clipRectangle, format);
  106. cache.Dispose();
  107. }
  108. }
  109. public override bool AllowFormSkin
  110. {
  111. get
  112. {
  113. return false;
  114. }
  115. }
  116. public string Caption
  117. {
  118. get
  119. {
  120. return this.caption;
  121. }
  122. set
  123. {
  124. this.caption = value;
  125. this.Refresh();
  126. }
  127. }
  128. }
  129. }

waitdialogform z的更多相关文章

  1. 【Python】使用torrentParser1.03对多文件torrent的分析结果

    Your environment has been set up for using Node.js 8.5.0 (x64) and npm. C:\Users\horn1>cd C:\User ...

  2. Winform使用DevExpress的WaitDialogForm画面 z

    使用了DevExpress的WaitDialogForm 在应用程序加载开始时新建一个线程,并将loading画面show起来,在应用程序画面弹出前将该线程终止. 代码: private DevExp ...

  3. Android立体旋转动画实现与封装(支持以X、Y、Z三个轴为轴心旋转)

    本文主要介绍Android立体旋转动画,或者3D旋转,下图是我自己实现的一个界面 立体旋转分为以下三种: 1. 以X轴为轴心旋转 2. 以Y轴为轴心旋转 3. 以Z轴为轴心旋转--这种等价于andro ...

  4. Z字形扫描(201412-2)

    问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan).给定一个n×n的矩阵,Z字形扫描的过程如下图所示: 对于下面的4×4的矩阵, 1 5 3 9 3 7 5 ...

  5. 【IOS】将一组包含中文的数据按照#ABC...Z✿分组

    上一篇文章[IOS]模仿windowsphone列表索引控件YFMetroListBox里面 我们一步步的实现了WindowsPhone风格的索引. 但是有没有发现,如果你要实现按照字母排序,你还得自 ...

  6. Java 压缩/ 解压 .Z 文件

    1.问题描述 公司项目有需要用 JAVA 解压 .z文件. .z 是 unix 系统常见的压缩文件. 2.源码 import com.chilkatsoft.CkUnixCompress; impor ...

  7. 中文编程语言Z语言开源正式开源!!!

    (Z语言基于.NET环境,源码中有很多高技术的代码,让更多的人知道对大家有会有很好的帮助,请管理员一点要批准放在首页) 本人实现的中文编程语言Z语言现在正式开源,采用LGPL协议. 编译器核心的网址为 ...

  8. CCF——Z字形扫描问题

    试题编号: 201412-2 试题名称: Z字形扫描 时间限制: 2.0s 内存限制: 256.0MB 问题描述: 问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag ...

  9. Z.ExtensionMethods 一个强大的开源扩展库

    今天有意的在博客园里面搜索了一下 Z.ExtensionMethods 这个扩展类库,确发现只搜到跟这个真正相关的才两篇博文而已,我都点进去看了一下,也都只是提到而已,没有专门介绍,才引起我写这篇文档 ...

随机推荐

  1. Ubuntu下编译安装OpenCV 2.4.7并读取摄像头

    主要参考: 1.http://www.ozbotz.org/opencv-installation/ 2.http://www.ozbotz.org/opencv-install-troublesho ...

  2. Spark(三)RDD与广播变量、累加器

    一.RDD的概述 1.1 什么是RDD RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是Spark中最基本的数据抽象,它代表一个不可变.可分区.里面的元素可 ...

  3. CentOS7.5安装与使用mysql-workbench

    1.下载 https://dev.mysql.com/downloads/workbench/ 要选开发版,通用版安装后要么闪退要么起不来 2.安装 rpm -ivh mysql-workbench- ...

  4. bzoj 1202: [HNOI2005]狡猾的商人

    我居然用暴力跑过去了... 思路:两个区间合成一个新的区间才会产生冲突, 我们用并查集维护前缀和, 0 - n 个节点分别表示sum[ 0 ] - sum[ n ], d[ i ] 表示 前缀i 和它 ...

  5. 问题:SpringBoot访问不到Controller

    SpringBoot正常启动,其它配置都正常,以下是控制台打印: 解决方法: 将controller与application配置文件同层,是访问时无法扫描到相应的controller,故无法映射到相应 ...

  6. 试水jdk8 stream

    jdk8出来日子不短了,jdk11都出来了,不过用的最多的不过是1.5罢了. 今年终于鼓起勇气认真对待它,在18年记录下学习stream,画上一个圆. 先看个图 Java8中有两大最为重要的改变.第一 ...

  7. python 与 mongodb的交互

  8. tensorflow模块安装

    有时候,我们的电脑上或许会同时安装多个python的环境,譬如,我的电脑上同时装了anaconda2和3. 在安装的时候,譬如,我想在python3中装tensorflow,则需要在 C:\Progr ...

  9. 【KTU Programming Camp (Day 3)】Queries

    http://codeforces.com/gym/100739/problem/A 按位考虑,每一位建一个线段树. 求出前缀xor和,对前缀xor和建线段树. 线段树上维护区间内的0的个数和1的个数 ...

  10. 数据准备<5>:变量筛选-实战篇

    在上一篇文章<数据准备<4>:变量筛选-理论篇>中,我们介绍了变量筛选的三种方法:基于经验的方法.基于统计的方法和基于机器学习的方法,本文将介绍后两种方法在Python(skl ...