启动表格同时(或之前)显示启动画面 [英] Startup Form shows at same time (or before) Splash Screen

查看:74
本文介绍了启动表格同时(或之前)显示启动画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序属性
启动表单是Menu.frm,它是MDI表单.
Splash是SplashScreen1.
应用程序事件中的代码为:
受保护的重写函数OnInitialize(ByVal commandLineArgs作为System.Collections.ObjectModel.ReadOnlyCollection(Of tring))作为布尔值
Me.MinimumSplashScreenDisplayTime = 2000
返回
MyBase.OnInitialize(commandLineArgs)
结束功能

当我运行
使用启动画面"对MDI表单显示的项目进行投影.
2秒后,启动画面消失

我只想看到启动画面",然后在2秒钟后看到MDI表单.

谢谢
Stephen

Application Properties
Startup Form is Menu.frm which is an MDI Form.
Splash is SplashScreen1.
Code in Application Events is:
Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of tring)) As Boolean
Me.MinimumSplashScreenDisplayTime = 2000
Return
MyBase.OnInitialize(commandLineArgs)
End Function

When I run the
project the MDI form shows with the Splash Screen.
After 2 seconds the Splash Screen disappears

I would like just to see the Splash Screen and then after 2 seconds the MDI Form.

Thanks
Stephen

推荐答案

如果使用VS2015,则基本代码应如下所示(按查看应用程序事件)

If using VS2015 the base code would look like this (by pressing view application events)

Imports Microsoft.VisualBasic.ApplicationServices

Namespace My
    ' The following events are available for MyApplication:
    ' Startup: Raised when the application starts, before the startup form is created.
    ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
    ' UnhandledException: Raised if the application encounters an unhandled exception.
    ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
    ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
    Partial Friend Class MyApplication
        Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup

        End Sub
    End Class
End Namespace

请注意,这不是函数.

如果出于某些原因Visual Studio提供了所显示的内容,则提出一个建议,将Return语句放置在代码的最后一行.

If for some reason Visual studio is providing what is shown then one suggestion, place the Return statement as the last line in the code.


这篇关于启动表格同时(或之前)显示启动画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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