📄 form3.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace lzl061111152357good5
{
/// <summary>
/// Form3 的摘要说明。
/// </summary>
public class Form3 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.ProgressBar progressBar2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
public Form3()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form3));
this.panel1 = new System.Windows.Forms.Panel();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.progressBar2 = new System.Windows.Forms.ProgressBar();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.statusBar1);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.progressBar2);
this.panel1.Controls.Add(this.progressBar1);
this.panel1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(400, 80);
this.panel1.TabIndex = 0;
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 56);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(398, 22);
this.statusBar1.TabIndex = 4;
this.statusBar1.Text = "statusBar1";
//
// statusBarPanel1
//
this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel1.Icon = ((System.Drawing.Icon)(resources.GetObject("statusBarPanel1.Icon")));
this.statusBarPanel1.Width = 212;
//
// statusBarPanel2
//
this.statusBarPanel2.Icon = ((System.Drawing.Icon)(resources.GetObject("statusBarPanel2.Icon")));
this.statusBarPanel2.Text = "lzl8407091110good5";
this.statusBarPanel2.Width = 140;
//
// statusBarPanel3
//
this.statusBarPanel3.Text = "0%";
this.statusBarPanel3.Width = 30;
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 16);
this.label2.TabIndex = 3;
this.label2.Text = "状态";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 16);
this.label1.TabIndex = 2;
this.label1.Text = "进度";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// progressBar2
//
this.progressBar2.Location = new System.Drawing.Point(56, 32);
this.progressBar2.Name = "progressBar2";
this.progressBar2.Size = new System.Drawing.Size(336, 16);
this.progressBar2.TabIndex = 1;
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(56, 8);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(336, 16);
this.progressBar1.TabIndex = 0;
//
// timer1
//
this.timer1.Interval = 10;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Form3
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(402, 80);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form3";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "进度条";
this.Load += new System.EventHandler(this.Form3_Load);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void Form3_Load(object sender, System.EventArgs e)
{
timer1.Start();
timer1.Enabled=true;
timer1.Interval=1;
}
private void timer1_Tick(object sender, System.EventArgs e)
{
int OneLevel=100;//Int32.Parse(this.textBox1.Text);
int TwoLevel=10000;//Int32.Parse(this.textBox2.Text);
this.progressBar1.Maximum=OneLevel;
this.progressBar2.Maximum=TwoLevel;
for(int i=1;i<=OneLevel;i++)
{
this.progressBar1.Value=i;
//this.label3.Text="+i.ToString()+";
for(int j=1;j<=TwoLevel;j++)
{
double d=i+j;
if(j%100==0) this.progressBar2.Value=j;//变化的进度条
//this.label4.Text=j+"%";
}
statusBarPanel3.Text=(i+"%");//一次性进度条
if(i<30&&i>=0)
{
statusBarPanel1.Text="本系统是库存管理系统!";
}
if(i<70&&i>30)
{
statusBarPanel1.Text="系统读入中......";
}
if(i<99&&i>70)
{
statusBarPanel1.Text="欢迎您的使用!呵呵!";
}
if(i==100)
{
timer1.Stop();
Form aaaa=new lzlMain();
aaaa.Show();
this.Hide();
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -