In the past I wrote a splash screen that used the override of OnPaint.
Its a little rusty, but does the job. I'm not used to vb... so excuse the look.
Make a splash form.
Get rid of the border, so set it to none.
Centre screen
I made mines size 485 x 300
Public Class Splash
Public barwidth As Integer = 200
Private Sub Splash_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim hfont As New Font("Arial", 12, FontStyle.Bold)
Dim font As New Font("Arial", 10, FontStyle.Regular)
e.Graphics.DrawString("Some Static Text", hfont, New SolidBrush(Color.Black), 33, 100)
e.Graphics.DrawString("More Static Text", font, New SolidBrush(Color.Black), 33, 120)
e.Graphics.DrawString("Loading..", font, New SolidBrush(Color.Gray), 33, 181)
ShowProgress(0, "Loading..")
End Sub
Public Sub ShowProgress(ByVal percentage As Integer, ByVal operation As String)
Dim font As New Font("Arial", 8, FontStyle.Regular)
Dim gr As Graphics = CreateGraphics()
gr.DrawRectangle(New Pen(Color.Black), New Rectangle(142, 202, barwidth, 19))
gr.FillRectangle(New SolidBrush(Color.FromArgb(255, 0, 0)), New Rectangle(143, 203, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(240, 0, 0)), New Rectangle(143, 204, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(230, 0, 0)), New Rectangle(143, 205, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(220, 0, 0)), New Rectangle(143, 206, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(210, 0, 0)), New Rectangle(143, 207, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(200, 0, 0)), New Rectangle(143, 208, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(195, 0, 0)), New Rectangle(143, 209, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(190, 0, 0)), New Rectangle(143, 210, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(185, 0, 0)), New Rectangle(143, 211, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(180, 0, 0)), New Rectangle(143, 212, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(175, 0, 0)), New Rectangle(143, 213, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(170, 0, 0)), New Rectangle(143, 214, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(165, 0, 0)), New Rectangle(143, 215, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(160, 0, 0)), New Rectangle(143, 216, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(155, 0, 0)), New Rectangle(143, 217, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(150, 0, 0)), New Rectangle(143, 218, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(145, 0, 0)), New Rectangle(143, 219, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(140, 0, 0)), New Rectangle(143, 220, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.FromArgb(135, 0, 0)), New Rectangle(143, 221, (barwidth * percentage) / 100, 1))
gr.FillRectangle(New SolidBrush(Color.IndianRed), New Rectangle(0, 250, 485, 50))
gr.DrawString(operation, font, New SolidBrush(Color.WhiteSmoke), 5, 250)
End Sub
End Class
That is what is in the back of the splash screen.
Barsize is pretty much how many pixels wide you want the bar to be.
This is what I have in my main form.
Imports System.Threading
Public Class Form1
Dim splashForm As Splash
Public Sub New()
Me.Enabled = False
splashForm = New Splash()
splashForm.Owner = Me
splashForm.Show()
Application.DoEvents()
Thread.Sleep(1000)
splashForm.ShowProgress(10, "Describe what you are loading here.....")
Thread.Sleep(1000)
splashForm.ShowProgress(25, "More description of loading here.....")
Thread.Sleep(1000)
splashForm.ShowProgress(70, "Bit more")
Thread.Sleep(1000)
splashForm.ShowProgress(100, "Finished!")
Thread.Sleep(1000)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Enabled = True
Me.Visible = True
splashForm.Close()
End Sub
End Class
I used this in a compact framework environment because I wanted a gradient progress bar on the splash screen.
There are probably loads of much better ways of doing it, but this method does work.
Just takes a bit of tweaking of coordinates!
Good luck!