• 0

[VB.NET] Splash Screen


Question

Hi,

I want to make splash screen but imidiatelly after loading all needed resources i would like to close the splash ... eg i done case where my splash becomes unvisible but i'm wondering how much memory it ask to stay opened all the time .... i.e. i have code:

If ProgressBar1.Value = 100 Then

 ? ? ? ? ? ?Splash_timer.Dispose()

 ? ? ? ? ? ?Me.Visible = False
 ? ? ? ? ? ?Dim cur = New Login
 ? ? ? ? ? ?cur.Show()
 ? ? ? ?End If

this code show me the login form but splash still keep going behind the all forms further .... lol

solution please

Edited by CD-ROM
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0
For one, don't use Me.Visible, use Me.Close() (Y)

584751617[/snapback]

But he/she wants to only hide the form, Me.Close() actually closes the form for good, perhaps using Me.Hide()

Link to comment
Share on other sites

  • 0
What's your main form?

If it's the splash screen you should, use Me.Visible = False, if it's a different form, use Me.Close()

584752053[/snapback]

A splashscreen should NEVER be your main window!!

Link to comment
Share on other sites

  • 0

Yeah ... actually i already done kinda misstake

A splashscreen should NEVER be your main window!!

in my case splash is main ... what is solution then (to hide another form before and after splash hide/close to show first one or what) ?

about that ... what i'm doing ... here is my explanation

Splash.vb is main form and after its role to present actions to client it should be closed or hiden .... i'm wondering is it kinda problem to stay opened and hiden and how much memory it use if runs in the background because it doesn't use any resources from this phase and so on

I'm using Timer and regard to timer i show message on splash actually i change the text properties of Label1 for instance ... then i'm opening login form and after login has to be open mainmenu form ... for login i'm using same trick like:

If bol = True Then
 ? ? ? ? ? ?Me.Visible = False
 ? ? ? ? ? ?Dim cur = New Menu
 ? ? ? ? ? ?cur.Show()

let's back on splash .... actually i don't know what i can say more about that .... here is the code i use for splash:

#Region "Splash"
 ? ?Private Sub Splash_timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Splash_timer.Tick

 ? ? ? ?ProgressBar1.Value += 2

 ? ? ? ?If ProgressBar1.Value <= 30 Then
 ? ? ? ? ? ?lblInfo.Text = "TEXT TEXT ....."
 ? ? ? ? ElseIf ProgressBar1.Value <= 50 Then
 ? ? ? ? ? ?lblInfo.Text = "TEXT TEXT ....."
 ? ? ? ?ElseIf ProgressBar1.Value <= 70 Then
 ? ? ? ? ? ?lblInfo.Text = "TEXT TEXT ...."
 ? ? ? ?ElseIf ProgressBar1.Value <= 100 Then
 ? ? ? ? ? ?lblInfo.Text = "Please Wait ...."
 ? ? ? ?End If
 ? ? ? ?If ProgressBar1.Value = 100 Then
 ? ? ? ? ? ?Splash_timer.Dispose()
            'here is my question
 ? ? ? ? ? ?Me.Visible = False
 ? ? ? ? ? ?Dim shwLogin = New Login
 ? ? ? ? ? ?shwLogin.Show()
 ? ? ? ?End If
 ? ?End Sub

#End Region

Thanks in advance

Link to comment
Share on other sites

  • 0
in my case splash is main ... what is solution then (to hide another form before and after splash hide/close to show first one or what) ?

584752271[/snapback]

What you should do is that you start the mainform minimized/hidden and activate the splashscreen in the onload (whatever it is called) event of the main form.

This way you can create->show->destroy the splash without the fear of closing the whole application.

If you let the splash be the main form you can never really close it without closing the application.... and this is certainly not a nice situation you got yourself into.

Not only that, but you will probably run into other situations during development where you will start to realize that making the splashscreen the main form wasn't such a great idea.

Link to comment
Share on other sites

  • 0

OK thanks a lot Schmoove, i really apreciate your help ... i will do it everything regard to your advice ... cause i already found that you are alright that splash is not good idea to be open all the time .... thanks for other members from above as well

Link to comment
Share on other sites

  • 0
What you should do is that you start the mainform minimized/hidden and activate the splashscreen in the onload (whatever it is called) event of the main form.

This way you can create->show->destroy the splash without the fear of closing the whole application.

If you let the splash be the main form you can never really close it without closing the application.... and this is certainly not a nice situation you got yourself into.

Not only that, but you will probably run into other situations during development where you will start to realize that making the splashscreen the main form wasn't such a great idea.

584752286[/snapback]

I still don't find that the best way, making a class that has a Sub Main(), and making that as the startup object, would allow control of alot of things before you want to show the main form or the splash form.

and in response to CD-ROM, even if the splash screen doesn't take much resource, your ultimate goal is to keep it as low as possible anyways.

Link to comment
Share on other sites

  • 0

Hi,

I overcome this issue but now arise a new issue ..... actually .... i would like to know what (and how much) could be advantage to have newest Crystal Reports v10 regard to version implemented in vs.NET 2003 .... mainly i would make simple reports for agreements/contracts and invoices for printing purpose.

Additionally can you give me one example (link off course) how i can simpliest make report with integrated Crystal Reports in Vb.net 2003 .... thanks in advance

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.