waitdialogform z


  1. namespaceDevExpress.Utils
  2. {
  3. usingDevExpress.LookAndFeel;
  4. usingDevExpress.Skins;
  5. usingDevExpress.Utils.Drawing;
  6. usingDevExpress.XtraEditors;
  7. usingSystem;
  8. usingSystem.ComponentModel;
  9. usingSystem.Drawing;
  10. usingSystem.Reflection;
  11. usingSystem.Windows.Forms;
  12. publicclassWaitDialogForm:XtraForm
  13. {
  14. privateFontboldFont;
  15. privatestringcaption;
  16. privateFontfont;
  17. privatePictureBoxpic;
  18. privatestringtitle;
  19. publicWaitDialogForm():this("")
  20. {
  21. }
  22. publicWaitDialogForm(stringcaption):this(caption,"")
  23. {
  24. }
  25. publicWaitDialogForm(stringcaption,Sizesize):this(caption,"",size,null)
  26. {
  27. }
  28. publicWaitDialogForm(stringcaption,stringtitle):this(caption,title,newSize(260,50),null)
  29. {
  30. }
  31. publicWaitDialogForm(stringcaption,stringtitle,Sizesize):this(caption,title,size,null)
  32. {
  33. }
  34. publicWaitDialogForm(stringcaption,stringtitle,Sizesize,Formparent)
  35. {
  36. this.caption="";
  37. this.title="";
  38. this.boldFont=newFont("Arial",9f,FontStyle.Bold);
  39. this.font=newFont("Arial",9f);
  40. this.caption=caption;
  41. this.title=(title=="")?"LoadingData.PleaseWait.":title;
  42. this.pic=newPictureBox();
  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+=newPaintEventHandler(this.WaitDialogPaint);
  59. this.pic.Size=newSize(0x10,0x10);
  60. this.pic.Location=newPoint(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. publicstringGetCaption()
  67. {
  68. returnthis.Caption;
  69. }
  70. protectedoverridevoidOnClosing(CancelEventArgse)
  71. {
  72. this.pic.Image=null;
  73. this.boldFont=null;
  74. this.font=null;
  75. base.OnClosing(e);
  76. }
  77. publicvoidSetCaption(stringnewCaption)
  78. {
  79. this.Caption=newCaption;
  80. }
  81. privatevoidWaitDialogPaint(objectsender,PaintEventArgse)
  82. {
  83. RectangleclipRectangle=e.ClipRectangle;
  84. clipRectangle.Inflate(-1,-1);
  85. GraphicsCachecache=newGraphicsCache(e);
  86. using(StringFormatformat=newStringFormat())
  87. {
  88. BrushsolidBrush=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,newSkinTextBorderPainter(base.LookAndFeel),newBorderObjectInfoArgs(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. publicoverrideboolAllowFormSkin
  110. {
  111. get
  112. {
  113. returnfalse;
  114. }
  115. }
  116. publicstringCaption
  117. {
  118. get
  119. {
  120. returnthis.caption;
  121. }
  122. set
  123. {
  124. this.caption=value;
  125. this.Refresh();
  126. }
  127. }
  128. }
  129. }
优质内容筛选与推荐>>
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字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号