ProgressBarForm

    public partial class ProgressBarForm : Form
{
private Panel panel1 = new System.Windows.Forms.Panel();
private ProgressBar progressBar1 = new System.Windows.Forms.ProgressBar(); public ProgressBarForm()
{
InitializeComponent();
InitializeComponent2();
} public int LoadProgressBarRate(float currentNum, float totalCount)
{
float add = / totalCount;
var currentBar = (int)Math.Ceiling(add * currentNum);
progressBar1.Value = currentBar >= && currentBar <= ? currentBar : ;
Application.DoEvents();
return currentNum == totalCount ? : ;
} private void InitializeComponent2()
{
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.progressBar1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(, );
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(, );
this.panel1.TabIndex = ;
//
// progressBar1
//
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill;
this.progressBar1.Location = new System.Drawing.Point(, );
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(, );
this.progressBar1.TabIndex = ;
//
// ProgressBarForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "ProgressBarForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "正在传输";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
}

最新文章

  1. 如何用java获得字符串的ASCII值
  2. DP:Cow Exhibition(POJ 2184)(二维问题转01背包)
  3. 添加数据源,管理工具--数据源(ODBC),点击添加不显示该驱动
  4. Falcon:三代reads比对组装工具箱
  5. Prime Palindromes
  6. UVa 11174 (乘法逆元) Stand in a Line
  7. HFile解析 基于0.96
  8. 李洪强iOS开发之自定义cell的使用
  9. (转)ASP.net的url重写
  10. 关于——NSThread
  11. 使用XmlReader读取xml文件之二
  12. 关闭 sqlserver提示信息
  13. C#将Word,Excel与Html,PDF互转
  14. Fragment管理
  15. 3n+1猜想——模拟
  16. BZOJ2268 : Wormly
  17. 手工搭建web项目
  18. SQL-15 查找employees表所有emp_no为奇数,且last_name不为Mary的员工信息,并按照hire_date逆序排列
  19. CorelDRAW X4常用快捷键大全
  20. FILE operattion

热门文章

  1. wix在使用heat自动生成wxs时添加windows服务组件
  2. Win10-IIS注册asp 此操作系统版本不支持此选项 错误解决方法
  3. Redis安装及局域网访问配置CentOS
  4. 在tomcat上部署项目
  5. JS知识点查漏补缺
  6. P1579
  7. mysql中date与datetime的区别
  8. DOCKSWARM服务网络原理
  9. mcast_unblock_source函数
  10. mysql服务删除成功,依然存在