Monday, 26 August 2013

Changing text in splashscreen

Changing text in splashscreen

I have created a splashscreen in VB.Net and everythings works perfect
except the fact that I would like to change the loading text with multiple
texts who changes every x seconds during the loading.

Exemple : Dim LoadingTexts As String = {"charging 1...", "charging 2...",
"info1..."}
I have no idea how i can do this apart the fact that i surely have to use
a timer... But how ?
Actual code:
Public Class frmSplashScreen
Private stringTable() As String = {"Shovelling coal into the
server...", "Programming the flux capacitor...", _
"Searching for answer to live, the
universe and everything...",
"Waiting for Godot...", "Starting..."}
Private stringMove As Integer = 0
Sub New()
InitializeComponent()
End Sub
Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal
arg As Object)
MyBase.ProcessCommand(cmd, arg)
End Sub
Public Enum SplashScreenCommand
SomeCommandId
End Enum
Public Sub SplashTimer_Tick(sender As Object, e As EventArgs) Handles
SplashTimer.Tick
Me.SplashTimer.Enabled = False
Me.labelStarting.Text = stringTable(stringMove)
Me.labelStarting.Refresh()
stringMove += 1
If stringMove < stringTable.Length Then Me.SplashTimer.Enabled = True
End Sub
End Class
Thanks.

No comments:

Post a Comment