JJ 21.09.15 Splashscreen
This commit is contained in:
84
app/DD-Record-Organiser/nveup4i1.png
Normal file
84
app/DD-Record-Organiser/nveup4i1.png
Normal file
@@ -0,0 +1,84 @@
|
||||
Public NotInheritable Class frmSplash
|
||||
|
||||
'TODO: Dieses Formular kann einfach als Begrüßungsbildschirm für die Anwendung festgelegt werden, indem Sie zur Registerkarte "Anwendung"
|
||||
' des Projekt-Designers wechseln (Menü "Projekt", Option "Eigenschaften").
|
||||
Private Init As ClassInit
|
||||
Private InitSteps As Integer = 4
|
||||
|
||||
Private Sub frmSplash_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
'Richten Sie den Dialogtext zur Laufzeit gemäß den Assemblyinformationen der Anwendung ein.
|
||||
|
||||
'TODO: Die Assemblyinformationen der Anwendung im Bereich "Anwendung" des Dialogfelds für die
|
||||
' Projekteigenschaften (im Menü "Projekt") anpassen.
|
||||
|
||||
'Anwendungstitel
|
||||
If My.Application.Info.Title <> "" Then
|
||||
ApplicationTitle.Text = My.Application.Info.Title
|
||||
Else
|
||||
'Wenn der Anwendungstitel fehlt, Anwendungsnamen ohne Erweiterung verwenden
|
||||
ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
|
||||
End If
|
||||
|
||||
'Verwenden Sie zum Formatieren der Versionsinformationen den Text, der zur Entwurfszeit in der Versionskontrolle festgelegt wurde, als
|
||||
' Formatierungszeichenfolge. Dies ermöglicht ggf. eine effektive Lokalisierung.
|
||||
' Build- und Revisionsinformationen können durch Verwendung des folgenden Codes und durch Ändern
|
||||
' des Entwurfszeittexts der Versionskontrolle in "Version {0}.{1:00}.{2}.{3}" oder einen ähnlichen Text eingeschlossen werden. Weitere Informationen erhalten Sie unter
|
||||
' String.Format() in der Hilfe.
|
||||
'
|
||||
' 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)
|
||||
|
||||
'Copyrightinformationen
|
||||
Copyright.Text = My.Application.Info.Copyright
|
||||
Me.BringToFront()
|
||||
|
||||
InitProgram()
|
||||
End Sub
|
||||
|
||||
Private Sub InitProgram()
|
||||
Init = New ClassInit()
|
||||
BackgroundWorker1.RunWorkerAsync()
|
||||
End Sub
|
||||
|
||||
Private Function CalcProgress(_step As Integer)
|
||||
Return _step * (100 / InitSteps)
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
|
||||
BackgroundWorker1.ReportProgress(CalcProgress(1), "Initialisiere Logger")
|
||||
Init.InitLogger()
|
||||
|
||||
System.Threading.Thread.Sleep(100)
|
||||
|
||||
BackgroundWorker1.ReportProgress(CalcProgress(2), "Initialisiere Datenbank")
|
||||
Init.InitDatabase()
|
||||
|
||||
System.Threading.Thread.Sleep(100)
|
||||
|
||||
BackgroundWorker1.ReportProgress(CalcProgress(3), "Initialisiere Windream-Einstellungen")
|
||||
Init.InitWindream()
|
||||
|
||||
System.Threading.Thread.Sleep(100)
|
||||
|
||||
BackgroundWorker1.ReportProgress(CalcProgress(4), "Initialisiere Benutzer")
|
||||
Init.InitUserLogin()
|
||||
End Sub
|
||||
|
||||
Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
|
||||
pbStatus.Value = e.ProgressPercentage
|
||||
lblStatus.Text = e.UserState.ToString()
|
||||
End Sub
|
||||
|
||||
Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
|
||||
' Bei Fehler MsgBox anzeigen und Programm beenden
|
||||
If e.Error IsNot Nothing Then
|
||||
MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Fehler beim Initialisieren")
|
||||
Application.Exit()
|
||||
End If
|
||||
|
||||
' Wenn kein Fehler, Splashscreen schließen
|
||||
Me.Close()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user