为了让您熟悉正在发生的事情,我正在开发Visual Studio 2010 PRO中的个人项目。它是一个桌面/表单应用程序,我的项目中有一个启动画面。启动画面应该加载并保持聚焦几秒钟,然后它应该关闭;留下主表格。
当我运行应用程序时,spash屏幕显示然后它关闭并结束整个应用程序。我相信我需要更改“Windows应用程序框架属性”中的默认设置,但它是灰色的,我无法进行任何选择。 (右键单击解决方案资源管理器中的项目文件 - >应用程序 - > Windows应用程序框架)
如果您知道如何配置这些设置,请提供一些帮助。同时,我强制使用frmSplashScreen.Hide()使其工作,当我希望程序停止时单击停止调试,这不太实用。
提前致谢。我复制了下面的一些代码。
Private Sub tmrSplashScreen_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSplashScreen.Tick
'Close the form after time value specified
Me.Hide()
frmHomeScreen.Show()
frmHomeScreen.Focus()
End Sub
答案 0 :(得分:0)
主要表格
dim splshScreen as frmSplashscreen = New frmSplashscreen()
private sub openSplashscreen()
'you are showing who is the parent by sending "me" with the showdialog
splshScreen.showdialog(me)
end sub
启动表格
Private Sub frmSplashscreen(sender As Object, e As System.EventArgs) Handles Me.Load
'Do something cool to load anything
if load = true then
me.close()
end if
end sub
所以基本上用父母打开对话框发送。然后给你的负载一个条件,并确保它完成后关闭。如果你只是使用me.close它应该没问题并且自己关闭