How can I show a splash form while my application loads? You know, I want it to be shown right after the running of program not as the first form of the program.
Thanks for your help, but i guess I couldnt convey exactly what i mean. You know usually on slow machines it takes a considerable time for a large application to load and run. I want the splash form to be shown in this period of time, but your code provieds a way of showing a splash form after the main form is loaded.
Yes it does - I have indicated where you should place any code that has to run procedures that will take some time.
You have to load your main form first. This is the way .net apps work.
If you place any intensive code where I suggest then the splash should be visible while you do this code.
Where are you actually having the slow loading comming from? What I mean by that is there is two ways your forms can be slow loading.
The first way, is right after you compile (build) your app to MSIL, the JIT compiler will then need to convert your app from MSIL to binary. This should only be the first time it is ran though. If you run it again after the first time, without rebuilding the solution, it should start up much faster.
The second way it can be slow, is if you have a form with a lot of controls on it. Assuming this is the second time you ran the app, not from the IDE, from the bin directory by double clicking the exe, and it is taking a while, then I would go with the above code posted by Lunatic3.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Opacity += 0.1
If Me.Opacity = 1 Then
Button1.Visible = True
End If
End Sub
code
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Opacity += 0.1
If Me.Opacity = 1 Then
Button1.Visible = True
Timer1.enabled = False
End If
End Sub