如何在Windows窗体应用程序的加载事件中应用计时器控件。 [英] How to apply a timer control in the loading event of a Windows form Application.

查看:137
本文介绍了如何在Windows窗体应用程序的加载事件中应用计时器控件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Windows窗体应用程序中,我想申请一个表格,该表格将是第一个具有软件名称和其他简要信息的表格。当用户运行应用程序时,将首先启动该表单,然后在几秒钟后该表单将自动隐藏,并且将启动主页。我不知道该怎么做?

请有人帮忙。

In my Windows Form Application, I want to apply a form which will be the first form having the software name and other brief information. When the user will run the application, that form will be started first, then after a few seconds that form will be hidden automatically and the homepage will be started. I don't know how to do this?
Please someone help.

推荐答案

CodeProject上有很多文章关于如何创建一个闪屏。



他们应该概述你需要的东西,看看这里 [ ^ ]



希望这会有所帮助,

Fredrik
There are loads of articles here on CodeProject on how to create a splash screen.

They should outline what you need, have a look here[^]

Hope this helps,
Fredrik


嗨Md Mashkoor Ahmad,



放置定时器控件,下面的示例代码适合您,查看并实现。

Hi Md Mashkoor Ahmad,

place the timer control and the below sample code is for you, look it and implement.
private void MainFrm_Load(object sender, EventArgs e) { timer1.Tick += new EventHandler(timer1_Tick);

        timer1.Enabled = true;
        timer1.Interval = 4000;
        timer1.Start();

    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        timer1.Stop();
        this.Hide();
        HomeFrm f = new HomeFrm();
        f.ShowDialog();
    }





谢谢,

SP



Thanks,
SP


这篇关于如何在Windows窗体应用程序的加载事件中应用计时器控件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆