Windows窗体VB应用程序..我添加了splashScreen到我的应用程序。它闪烁只有一秒钟然后消失,所以我添加了一个睡眠计时器到我的表单加载事件...现在的问题是splashScreen保持打开,即使在应用程序退出后,而不是简单地在sleeptimer结束时关闭..导致此窗体的Load事件的部分如下:即使在应用程序退出后仍然保持打开屏幕
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创建一个股票闪屏。它的代码如下: 公共NotInheritable类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
末级
没有什么更多的与此相关的功能在所有..其余部分用来填充表单标签和textboxes ...如果我删除了Threading.Thread.Sleep(5000)这一行,初始屏幕只会闪烁一秒,但在完成后退出。任何想法?
无影响u能告诉我其中U调用闪屏的代码。从哪里创建启动画面的对象并使其可见。 – kbvishnu
查看输出窗口,您是否看到“第一次机会异常”通知? –
输出中没有第一次机会异常通知.. – Skindeep2366