ProgressPanel Class | ![]() |
控件 指示进度条
Assembly: DevExpress.XtraEditors.vXX.dll
| ||||||
|
为一个进度条控件
每一个皮肤ProgressPanel包含自己的动画图片.
许多方式可以选择皮肤。
LookAndFeel.UseDefaultLookAndFeel =true或者 UseDefaultLookAndFeel =false并设置LookAndFeel属性的SkinName属性
下面是皮肤示例。
如果需要在单独的窗体显示进度面板,使用WaitForm ,它由 SplashScreenManager 负责管理。
---------------------------------------------Namespace:DevExpress.XtraWaitForm
Assembly: DevExpress.XtraEditors.
| ||||||
|
A WaitForm 包含一个动画图像 (由当前皮肤获取) and 两个自定义标签(标题和描述) :
To create a Wait Form, drop a SplashScreenManager component onto your form, click the component's tag and then click the Add Wait Form link in the SplashScreenManager Tasks window that will open:
This generates a WaitForm's descendant that you can modify at design time.
A Wait Form 需要手动控制显示, 使用SplashScreenManager 提供的方法,主要控制方法为:
splashScreenManager.ShowWaitForm();
splashScreenManager.CloseWaitForm();
-------------------------------------------SplashScreenManager -----------------------------------
splashScreenManager这个控件的主要作用就是显示程序集加载之前的进度条显示和进行耗时操作时候的等待界面。窗体加载完成后会自动消失。可以通过在
private void MainForm_Load(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
}
测试。
1.新建一个Windows窗体,在工具栏Navigation和Layout中找到SplashScreenManager,把它拖放到Windows窗体中。
2.找到这个控件,点击右上角的三角图标,出现如下显示的下拉菜单,点击“Add Splash Screen”然后打开解决方案资源管理器,你会发现多了一个名为“SplashScreen1.cs”的窗体,打开它,如下图所示:
3.两个图片、标签控件和一个进度条控件,可以根据自己的需要进行修改。
4.然后在程序入口出加上如下代码,就可以显示在程序加载之前显示进度条了(不添加下面的代码一样可以显示效果)
第二种方式:添加“正在加载"
点击splashScreenManager1控件右上角的三角图标,出现如下显示的下拉菜单,点击“Add Wait Form”然后打开解决方案资源管理器,你会发现多了一个名为“WaitForm1.cs”的窗体,打开它,如下图所示:
在按钮单击事件中加入如下代码:就可以实现“正在加载”的提示了。