延长启动画面时间 [英] Extending splash screen time

查看:79
本文介绍了延长启动画面时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net 2008中延长启动画面的时间?



我有2个表单,一个是我的主要表单(frmMain),另一个是我的启动屏幕(frmSplash)。在项目属性中,我将开始表单设置为frmMain,并在启动画面frmSplash中设置。当我运行我的项目时,启动画面显示仅2秒。我怎样才能延长时间?





提前谢谢。

解决方案

< blockquote>在启动表格上添加计时器控件

和点击事件put如果条件在计时器的时间超过欲望时间然后关闭表格并启用你的MDI表格< br $> b $ b

快乐的编码!

:)


你可以这样编码:



 Private Sub SplashScreenForm_Shown(发送者作为对象,e作为EventArgs)处理Me.Shown 
Application.DoEvents()
Dim sw作为新秒表
sw.Start()
Do:Loop while sw.ElapsedMilliseconds< 3000
结束子


在主表单中尝试:



 公开  MainForm 

< span class =code-keyword>私有 WithEvents tmr As 计时器

私有 Sub MainForm_Load (发件人作为 对象,e 作为 EventArgs )句柄 MyBase .Load
tmr.Interval = 5000
tmr.Enabled = True

执行 while tmr.Enabled
Applica .DoEvents()
循环
结束 Sub

私有 Sub tmr_Tick()< span class =code-keyword>句柄 tmr.Tick
tmr.Enabled = False
结束 Sub

结束


How to extend time of splash screen in vb.net 2008?

I have 2 forms one is my main form(frmMain) and the other is my splash screen(frmSplash). In project properties I set the start form to frmMain and in splash screen frmSplash. When I run my project the splash screen display only 2 seconds. How can I extend the time?


thanks in advance.

解决方案

add timer control on splash form
and on tick event put if condition when timer''s time goes greater than desire time then close form and enable your MDI form

Happy coding!
:)


You can code this:

Private Sub SplashScreenForm_Shown(sender As Object, e As EventArgs) Handles Me.Shown
   Application.DoEvents()
   Dim sw As New Stopwatch
   sw.Start()
   Do : Loop While sw.ElapsedMilliseconds < 3000
 End Sub


Try this in your main form:

Public Class MainForm

    Private WithEvents tmr As New Timer

    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        tmr.Interval = 5000
        tmr.Enabled = True

        Do While tmr.Enabled
            Application.DoEvents()
        Loop
    End Sub

    Private Sub tmr_Tick() Handles tmr.Tick
        tmr.Enabled = False
    End Sub

End Class


这篇关于延长启动画面时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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