画面1代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
progressBar1.Minimum = 0;//设置ProgressBar组件最小值为0
progressBar1.Maximum = 10;//Maximum最大值为10
progressBar1.MarqueeAnimationSpeed = 50;//设定进度快在进度栏中移动的时间段
timer1.Start();//启动定时器
}
private void timer1_Tick(object sender, EventArgs e)
{
//定时时间到了处理事件
this.Hide();//隐藏本窗体
Form2 MainForm = new Form2();//实例化一个MainForm对象
MainForm.Show();//显示窗体
timer1.Stop();//定制定时器
}
}
}
画面2代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();//退出应用程序
}
}
}
画面1
画面2