TinyMind
.net.cn
首页
资讯
文章
注册
登录
waitdialogform z
武胜-阿伟
关注文章
TinyMind专栏频道
namespaceDevExpress.Utils
{
usingDevExpress.LookAndFeel;
usingDevExpress.Skins;
usingDevExpress.Utils.Drawing;
usingDevExpress.XtraEditors;
usingSystem;
usingSystem.ComponentModel;
usingSystem.Drawing;
usingSystem.Reflection;
usingSystem.Windows.Forms;
publicclassWaitDialogForm:XtraForm
{
privateFontboldFont;
privatestringcaption;
privateFontfont;
privatePictureBoxpic;
privatestringtitle;
publicWaitDialogForm():this("")
{
}
publicWaitDialogForm(stringcaption):this(caption,"")
{
}
publicWaitDialogForm(stringcaption,Sizesize):this(caption,"",size,null)
{
}
publicWaitDialogForm(stringcaption,stringtitle):this(caption,title,newSize(260,50),null)
{
}
publicWaitDialogForm(stringcaption,stringtitle,Sizesize):this(caption,title,size,null)
{
}
publicWaitDialogForm(stringcaption,stringtitle,Sizesize,Formparent)
{
this.caption="";
this.title="";
this.boldFont=newFont("Arial",9f,FontStyle.Bold);
this.font=newFont("Arial",9f);
this.caption=caption;
this.title=(title=="")?"LoadingData.PleaseWait.":title;
this.pic=newPictureBox();
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+=newPaintEventHandler(this.WaitDialogPaint);
this.pic.Size=newSize(0x10,0x10);
this.pic.Location=newPoint(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();
}
publicstringGetCaption()
{
returnthis.Caption;
}
protectedoverridevoidOnClosing(CancelEventArgse)
{
this.pic.Image=null;
this.boldFont=null;
this.font=null;
base.OnClosing(e);
}
publicvoidSetCaption(stringnewCaption)
{
this.Caption=newCaption;
}
privatevoidWaitDialogPaint(objectsender,PaintEventArgse)
{
RectangleclipRectangle=e.ClipRectangle;
clipRectangle.Inflate(-1,-1);
GraphicsCachecache=newGraphicsCache(e);
using(StringFormatformat=newStringFormat())
{
BrushsolidBrush=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,newSkinTextBorderPainter(base.LookAndFeel),newBorderObjectInfoArgs(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();
}
}
publicoverrideboolAllowFormSkin
{
get
{
returnfalse;
}
}
publicstringCaption
{
get
{
returnthis.caption;
}
set
{
this.caption=value;
this.Refresh();
}
}
}
}
优质内容筛选与推荐
>>
1、Castle学习:一DynamicProxy的功能
2、微信小程序----map组件实现检索【定位位置】周边的POI
3、FATFS简介
4、Magento1.9 add attribute to catalog product & assign to all attribute set general group
5、可以直接cat 多个fq.gz压缩文件
赞赏
长按二维码向我转账
受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。
阅读
好看
已推荐到看一看
你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
取消
推荐
我知道了
已取消,“好看”想法已同步删除
知道了
已推荐到看一看
和朋友分享想法
最多200字,当前共
字
发送
已发送
朋友将在看一看看到
确定
分享你的想法...
取消
分享想法到看一看
确定
最多200字,当前共
字
发送中
网络异常,请稍后重试
知道了
微信扫一扫
关注该公众号
0
│
收藏
│
举报