Windows 窗体 VB 应用程序。我在我的应用程序中添加了一个 splashScreen。它只闪烁了一秒钟然后就消失了,所以我在我的表单加载事件中添加了一个睡眠计时器......现在的问题是即使在应用程序退出后,splashScreen 仍然保持打开状态,而不是简单地在睡眠计时器结束时关闭......导致此问题的表单加载事件部分如下:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
Threading.Thread.Sleep(5000)
Me.WindowState = FormWindowState.Maximized
Dim _year As String = System.DateTime.Now.Year.ToString
我正在使用通过转到 myproject 创建的股票 Splashscreen。它的代码如下: Public NotInheritable Class SplashScreen1
'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab
' of the Project Designer ("Properties" under the "Project" menu).
Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Set up the dialog text at runtime according to the application's assembly information.
'TODO: Customize the application's assembly information in the "Application" pane of the project
' properties dialog (under the "Project" menu).
'Application title
If My.Application.Info.Title <> "" Then
Else
'If the application title is missing, use the application name, without the extension
'ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
End If
'Format the version information using the text set into the Version control at design time as the
' formatting string. This allows for effective localization if desired.
' Build and revision information could be included by using the following code and changing the
' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See
' String.Format() in Help for more information.
'
' Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)
Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
'Copyright info
Copyright.Text = My.Application.Info.Copyright
End Sub
结束类
函数中没有更多与此相关的内容。其余部分用于填充表单标签和文本框...如果我删除 Threading.Thread.Sleep(5000) 行,则启动屏幕只会闪烁一秒钟,但完成后退出..有什么想法吗?