欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

c#進(jìn)度條 progressBar 使用方法的小例子

 更新時間:2013年04月16日 10:35:30   作者:  
1、創(chuàng)建進(jìn)度條窗口2、在其他窗口中調(diào)用方法ShowProcess(int percent,string message)

復(fù)制代碼 代碼如下:

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

namespace HCMDoImport
{
    public partial class ProcessBarForm : BaseForm
    {
        int processPercent = 0;
        string message = "";

        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                this.label1.Text = message;
            }
        }

        public int ProcessPercent
        {
            get { return processPercent; }
            set
            {
                processPercent = value;
                if (processPercent >= 100)
                    this.Close();
                this.progressBar1.Value = processPercent;
            }
        }

        public ProcessBarForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 更新進(jìn)度
        /// </summary>
        /// <param name="percent">進(jìn)度,小于等于100</param>
        /// <param name="message">消息</param>
        public void ShowProcess(int percent,string message)
        {
            this.Show();
            this.ProcessPercent = percent;
            this.Message = message;
            this.progressBar1.Refresh();
            this.label1.Refresh();
        }

        private void ProcessBarForm_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
        }

        private void ProcessBarForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Cursor = Cursors.Default;
        }
    }
}

相關(guān)文章

最新評論