waitdialogform z
- namespace DevExpress.Utils
- {
- using DevExpress.LookAndFeel;
- using DevExpress.Skins;
- using DevExpress.Utils.Drawing;
- using DevExpress.XtraEditors;
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.Reflection;
- using System.Windows.Forms;
- public class WaitDialogForm : XtraForm
- {
- private Font boldFont;
- private string caption;
- private Font font;
- private PictureBox pic;
- private string title;
- public WaitDialogForm() : this("")
- {
- }
- public WaitDialogForm(string caption) : this(caption, "")
- {
- }
- public WaitDialogForm(string caption, Size size) : this(caption, "", size, null)
- {
- }
- public WaitDialogForm(string caption, string title) : this(caption, title, new Size(260, 50), null)
- {
- }
- public WaitDialogForm(string caption, string title, Size size) : this(caption, title, size, null)
- {
- }
- public WaitDialogForm(string caption, string title, Size size, Form parent)
- {
- this.caption = "";
- this.title = "";
- this.boldFont = new Font("Arial", 9f, FontStyle.Bold);
- this.font = new Font("Arial", 9f);
- this.caption = caption;
- this.title = (title == "") ? "Loading Data. Please Wait." : title;
- this.pic = new PictureBox();
- base.FormBorderStyle = FormBorderStyle.FixedDialog;
- base.ControlBox = false;
- base.ClientSize = size;
- if (parent == null)
- {
- base.StartPosition = FormStartPosition.CenterScreen;
- }
- else
- {
- base.StartPosition = FormStartPosition.Manual;
- base.Left = parent.Left + ((parent.Width - base.Width) / 2);
- base.Top = parent.Top + ((parent.Height - base.Height) / 2);
- }
- base.ShowInTaskbar = false;
- base.TopMost = true;
- base.Paint += new PaintEventHandler(this.WaitDialogPaint);
- this.pic.Size = new Size(0x10, 0x10);
- this.pic.Location = new Point(8, (base.ClientSize.Height / 2) - 0x10);
- this.pic.Image = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("DevExpress.Utils.wait.gif"));
- base.Controls.Add(this.pic);
- base.Show();
- this.Refresh();
- }
- public string GetCaption()
- {
- return this.Caption;
- }
- protected override void OnClosing(CancelEventArgs e)
- {
- this.pic.Image = null;
- this.boldFont = null;
- this.font = null;
- base.OnClosing(e);
- }
- public void SetCaption(string newCaption)
- {
- this.Caption = newCaption;
- }
- private void WaitDialogPaint(object sender, PaintEventArgs e)
- {
- Rectangle clipRectangle = e.ClipRectangle;
- clipRectangle.Inflate(-1, -1);
- GraphicsCache cache = new GraphicsCache(e);
- using (StringFormat format = new StringFormat())
- {
- Brush solidBrush = cache.GetSolidBrush(LookAndFeelHelper.GetSystemColor(base.LookAndFeel, SystemColors.WindowText));
- format.Alignment = format.LineAlignment = StringAlignment.Center;
- format.Trimming = StringTrimming.EllipsisCharacter;
- if (base.LookAndFeel.ActiveLookAndFeel.ActiveStyle == ActiveLookAndFeelStyle.Skin)
- {
- ObjectPainter.DrawObject(cache, new SkinTextBorderPainter(base.LookAndFeel), new BorderObjectInfoArgs(null, clipRectangle, null));
- }
- else
- {
- ControlPaint.DrawBorder3D(e.Graphics, clipRectangle, Border3DStyle.RaisedInner);
- }
- clipRectangle.X += 30;
- clipRectangle.Width -= 30;
- clipRectangle.Height /= 3;
- clipRectangle.Y += clipRectangle.Height / 2;
- e.Graphics.DrawString(this.title, this.boldFont, solidBrush, clipRectangle, format);
- clipRectangle.Y += clipRectangle.Height;
- e.Graphics.DrawString(this.caption, this.font, solidBrush, clipRectangle, format);
- cache.Dispose();
- }
- }
- public override bool AllowFormSkin
- {
- get
- {
- return false;
- }
- }
- public string Caption
- {
- get
- {
- return this.caption;
- }
- set
- {
- this.caption = value;
- this.Refresh();
- }
- }
- }
- }
waitdialogform z的更多相关文章
- 【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 ...
- Winform使用DevExpress的WaitDialogForm画面 z
使用了DevExpress的WaitDialogForm 在应用程序加载开始时新建一个线程,并将loading画面show起来,在应用程序画面弹出前将该线程终止. 代码: private DevExp ...
- Android立体旋转动画实现与封装(支持以X、Y、Z三个轴为轴心旋转)
本文主要介绍Android立体旋转动画,或者3D旋转,下图是我自己实现的一个界面 立体旋转分为以下三种: 1. 以X轴为轴心旋转 2. 以Y轴为轴心旋转 3. 以Z轴为轴心旋转--这种等价于andro ...
- Z字形扫描(201412-2)
问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan).给定一个n×n的矩阵,Z字形扫描的过程如下图所示: 对于下面的4×4的矩阵, 1 5 3 9 3 7 5 ...
- 【IOS】将一组包含中文的数据按照#ABC...Z✿分组
上一篇文章[IOS]模仿windowsphone列表索引控件YFMetroListBox里面 我们一步步的实现了WindowsPhone风格的索引. 但是有没有发现,如果你要实现按照字母排序,你还得自 ...
- Java 压缩/ 解压 .Z 文件
1.问题描述 公司项目有需要用 JAVA 解压 .z文件. .z 是 unix 系统常见的压缩文件. 2.源码 import com.chilkatsoft.CkUnixCompress; impor ...
- 中文编程语言Z语言开源正式开源!!!
(Z语言基于.NET环境,源码中有很多高技术的代码,让更多的人知道对大家有会有很好的帮助,请管理员一点要批准放在首页) 本人实现的中文编程语言Z语言现在正式开源,采用LGPL协议. 编译器核心的网址为 ...
- CCF——Z字形扫描问题
试题编号: 201412-2 试题名称: Z字形扫描 时间限制: 2.0s 内存限制: 256.0MB 问题描述: 问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag ...
- Z.ExtensionMethods 一个强大的开源扩展库
今天有意的在博客园里面搜索了一下 Z.ExtensionMethods 这个扩展类库,确发现只搜到跟这个真正相关的才两篇博文而已,我都点进去看了一下,也都只是提到而已,没有专门介绍,才引起我写这篇文档 ...
随机推荐
- 实战MEF(1)一种不错的扩展方式
在过去,我们完成一套应用程序后,如果后面对其功能进行了扩展或修整,往往需要重新编译代码生成新的应用程序,然后再覆盖原来的程序.这样的扩展方式对于较小的或者不经常扩展和更新的应用程序来说是可以接受的,而 ...
- ****jQuery - 设置HTML内容和属性
设置内容 - text().html() 以及 val() 我们将使用前一章中的三个相同的方法来设置内容: text() - 设置或返回所选元素的文本内容 html() - 设置或返回所选元素的内容( ...
- 批处理命令篇--配置免安装mysql
免安装版的mysql是进行软件绿色发布的绝佳助手,本文介绍一种使用批处理命令自动配置mysql的方法. (1)建立三个文件,分别是:service install.bat,temp.txt,updat ...
- nsis安装包_示例脚本语法解析
以下是代码及解析,其中有底色的部分为脚本内容. 注释.!define.变量.!include.常量 ; Script generated by the HM NIS Edit Script Wizar ...
- Web Api 的 路由机制
ASP.NET Web API 是一种框架,用于轻松构建可以访问多种客户端(包括浏览器和移动设备)的 HTTP 服务. ASP.NET Web API 是一种用于在 .NET Framework 上构 ...
- windows svn post-commit 报错解决 error resolving case
在svn仓库目录下有个hooks目录,下面建一个 post-commit.cmd 文件,有代码提交到仓库,自动checkout到指定目录. @echo onSET REPOS=%1SET USER ...
- 计蒜客 38229.Distance on the tree-1.树链剖分(边权)+可持久化线段树(区间小于等于k的数的个数)+离散化+离线处理 or 2.树上第k大(主席树)+二分+离散化+在线查询 (The Preliminary Contest for ICPC China Nanchang National Invitational 南昌邀请赛网络赛)
Distance on the tree DSM(Data Structure Master) once learned about tree when he was preparing for NO ...
- django.db.utils.OperationalError: 1045错误
django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using pass ...
- 转 Java高级程序员面试题
1.你认为项目中最重要的过程是那些? 分析.设计阶段 尽量找出进度的优先级 2.如果给你一个4-6人的team,怎么分配? 挑选一技术过硬的人作为我的替补.其它人平均分配任务,每周进行全面的任务分配 ...
- Xshell拖拽上传文件插件
lrzsz是一款在linux里可代替ftp上传和下载的程序.在linux中支持直接拖拽上传的插件:同时也支持rz和sz进行命令上传和下载. 插件安装 yum -y install lrzsz 上传(r ...