我试图让启动画面首先出现并在启动后MainForm出现.但是我在启动画面中的进度条没有到达栏的末尾.程序继续运行而不起作用.
如何在加载主窗体期间显示启动画面?
我的代码就是这样的:
public partial class SplashForm : Form
{
public SplashForm()
{
InitializeComponent();
}
private void SplashForm_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Start();
timer1.Interval = 1000;
progressBar1.Maximum = 10;
timer1.Tick += new EventHandler(timer1_Tick);
}
public void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value != 10)
{
progressBar1.Value++;
}
else
{
timer1.Stop();
Application.Exit();
}
}
}
Run Code Online (Sandbox Code Playgroud)
以下是代码的第一部分MainForm:
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
Application.Run(new SplashForm());
}
}
Run Code Online (Sandbox Code Playgroud) 我想取消选择我在JFrame中的程序中的单选按钮,它有一些方法可以通过一个名为Clean的按钮来取消选择所有单选按钮吗?此按钮将清洁辐射按钮和具有的文本.
行动的代码将使干净所有人认为:
JButton btnClean = new JButton("Clean");
btnClean.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
}
});
btnClean.setBounds(208, 184, 126, 28);
contentPane.add(btnClean);
Run Code Online (Sandbox Code Playgroud)