陈程的技术博客

  • 关于作者
全栈软件工程师
一个专注于技术研究创新的程序员
  1. 首页
  2. .NET
  3. 正文

DevExpress控件-使用ProgressPanel控件

2016年3月9日 1040点热度 0人点赞 0条评论

1.先创建一个WaitForm 的窗体,或者随便Form窗体,只需要继承WaitForm窗体就行。

2.把控件拉入窗体,调整为合适的大小。

3.设置控件的样式,DevExpress给等待框默认设置了非常多的样式,如图2 设置,UseDefaultLookAndFeel设置为False,即不采用默认样式,这样系统就会取SkinName设置的样式。

4.WaitForm后台常用设置代码

public partial class AppWaitForm : WaitForm
   {
       public AppWaitForm()
       {
           InitializeComponent();
           this.progressPanel.AutoHeight = true;
       }

       #region Overrides

       public override void SetCaption(string caption)
       {
           base.SetCaption(caption);
           this.progressPanel.Caption = caption;
       }
       public override void SetDescription(string description)
       {
           base.SetDescription(description);
           this.progressPanel.Description = description;
       }
       public override void ProcessCommand(Enum cmd, object arg)
       {
           base.ProcessCommand(cmd, arg);
       }

       #endregion
   }

5.窗体调用该控件的方法。

5.1 先在需要使用的窗体上拖入控件SplashScreenManager。如图3

5.2 属性ActiveSplashFormTypeInfo是设置该控件关联到我们之前写的WaitForm窗体,如图4.

5.3 后台调用代码如下:

private void LoginView_Load(object sender, EventArgs e)
   {
       splashScreenManager.ShowWaitForm();
       //上部分提示
       splashScreenManager.SetWaitFormCaption("请等待");
       //下面长描述
       splashScreenManager.SetWaitFormDescription("加载中...");
       Init();
       //关闭时判断是否等待窗体是否正在运行
       if (splashScreenManager.IsSplashFormVisible)
           splashScreenManager.CloseWaitForm();
   }

 

6.等待窗体的各种样式:图5

标签: C# DevExpress
最后更新:2021年4月1日

博主

全栈工程师,侧重项目技术解决方案规划和开发

打赏 点赞
< 上一篇
下一篇 >

文章评论

取消回复

分类
  • .NET (65)
  • docker (3)
  • linux (12)
  • python (20)
  • web (14)
  • 小程序 (4)
  • 数据库 (2)
  • 未分类 (4)
  • 杂七杂八 (10)
标签聚合
nginx centos linux js C# DevExpress winform python
最新 热点 随机
最新 热点 随机
.NET开发手册标准参考 招募兼职前端开发 Centos安装dotnet6环境 VS上切换分支,vs编译运行出现bug,A fatal error was encountered彻底解决方案 用C#封装一个线程安全的缓存器,达到目标定时定量更新入库 C#通过特性的方式去校验指定数据是否为空
winform 微秒级别的定时器 winform应用程序幻灯片设计 提供一个.net的讯飞在线语音合成SDK Naudio实现声卡采集麦克风采集+混音 Bat脚本执行打开文件夹中的exe 用ASP.NET写一个简单的WebAPI

COPYRIGHT © 2021 陈程的技术博客. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS