手机
当前位置:查字典教程网 >编程开发 >C#教程 >c#进度条 progressBar 使用方法的小例子
c#进度条 progressBar 使用方法的小例子
摘要:复制代码代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.Compo...

复制代码 代码如下:

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>

/// 更新进度

/// </summary>

/// <param name="percent">进度,小于等于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;

}

}

}

【c#进度条 progressBar 使用方法的小例子】相关文章:

C#修改MAC地址类的实例

c#剪切板操作的简单实例

解析C#中@符号的几种使用方法详解

深入DropDownList用法的一些学习总结分析

重写、隐藏基类(new, override)的方法

C#中使用split分割字符串的几种方法小结

c# 通过经纬度查询 具体的地址和区域名称

C#控制台输出进度和百分比的实例代码

C# 委托(delegate) 的小例子

C# SendKeys使用方法介绍

精品推荐
分类导航