zoukankan      html  css  js  c++  java
  • 使用timer控件控制进度条

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace ECS.Simulate
    {
        public partial class FrmProgress : Form
        {
            public FrmProgress()
            {
                InitializeComponent();
                this.CenterToParent();
                progressBar1.Maximum = 1000;
                progressBar1.Step = 10;
                timer1.Enabled = true;
            }

            private void FrmProgress_Load(object sender, EventArgs e)
            {

            }

            private void timer1_Tick(object sender, EventArgs e)
            {
                if (this.progressBar1.Value == this.progressBar1.Maximum)
                {
                    this.progressBar1.Value = this.progressBar1.Minimum;
                }
                else
                {
                    if (StatusData.flag)
                    {
                        this.progressBar1.PerformStep();
                        this.Close();
                        this.Dispose();
                        GC.Collect();
                        StatusData.flag = false;
                    }
                    this.progressBar1.PerformStep();
                }
            }
        }

        public class StatusData
        {
            public static bool flag = false;
        }

    }

  • 相关阅读:
    递归的形式过程
    c/c++程序员常见面试题分析(转)
    深入理解递归函数的调用过程(转)
    C语言union关键字
    中国象棋(java)
    求树中最低的公共祖先
    什么是Complement(补码)?
    LoadRunner,各协议之间的区别
    淘宝模板制作[店铺装修]学习过程+心得
    Tips of QTP
  • 原文地址:https://www.cnblogs.com/wuhuisheng/p/3231996.html
Copyright © 2011-2022 走看看