zoukankan      html  css  js  c++  java
  • XtraEditors七、ProgressBarControl、MarqueeProgressBarControl、ProgressPanel控件

    一、ProgressBarControl

    进度条控件

    效果如下:

    示例代码:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Linq;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using DevExpress.XtraEditors;
    using System.IO;
    using System.Threading;
    
    namespace DXApplication_1
    {
        public partial class ProgressBarControlForm : DevExpress.XtraEditors.XtraForm
        {
            public ProgressBarControlForm()
            {
                InitializeComponent();
            }
            private void Encapsulation_DeleteFiles()
            {
                string dirPath = "C:\Users\teeking_scx\source\repos\DXApplication_1\test";
                if (Directory.Exists(dirPath))
                {
                    string[] fileArr = Directory.GetFiles(dirPath);
                    progressBarControl1.Properties.Step = 1;
                    progressBarControl1.Properties.PercentView = true;
                    progressBarControl1.Properties.Maximum = fileArr.Length;
                    progressBarControl1.Properties.Minimum = 0;
                    Thread.Sleep(10000);
                    foreach (string fileName in fileArr) {
                        File.Delete(fileName);
                        progressBarControl1.PerformStep();
                        progressBarControl1.Update();
                        Thread.Sleep(1000);
                    }
                }
            }
            private void ProgressBarControl_Load(object sender, EventArgs e)
            {
                //方法一:使用Thread类
                ThreadStart threadStart = new ThreadStart(Encapsulation_DeleteFiles);//通过ThreadStart委托告诉子线程执行什么方法  
                Thread thread = new Thread(threadStart);
                thread.Start();//启动新线程
            }
        }
    }

    二、MarqueeProgressBarControl控件

    ShowTitle表示显示文本

    Text属性显示在运动时显示的文本;

    其Properties属性下的MarqueeAnimationSpeed属性控制其滚动速度

    如图所示:

    代码如下:

    marqueeProgressBarControl1.Properties.MarqueeAnimationSpeed = 100;
     marqueeProgressBarControl1.Properties.ShowTitle = true;  marqueeProgressBarControl1.Text = "Loading...";

    三、ProgressPanel控件

    该控件是用来表示任何操作的进度,

    该控件包含一个动画图像两个标签

    其中两个标签分别用来指定标题描述属性;

    如图:

    ProgressPanel 包含了许多图像,可以手动指定显示的图像格式,

    通过LookAndFeel属性来设定,

    示例代码:

    ProgressPanel progressPanel1 = new ProgressPanel();
    Controls.Add(progressPanel1);
    progressPanel1.LookAndFeel.SkinName = "DevExpress Dark Style";
    progressPanel1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat;
    progressPanel1.LookAndFeel.UseDefaultLookAndFeel = false;
  • 相关阅读:
    给任意多个链表然后要合并成一个
    hdu5967数学找规律+逆元
    poj2125最小点权覆盖+找一个割集
    poj3308 最小点权覆盖
    poj2987 最大闭合权子图基础题
    poj2699 转化为可行性判定问题+二分枚举+最大流
    判断割是否唯一zoj2587
    快排优化
    jvm垃圾收集器
    三次握手与四次挥手
  • 原文地址:https://www.cnblogs.com/springsnow/p/10298705.html
Copyright © 2011-2022 走看看