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