473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

## Startup Forms and Splash screen Problem - Please help me!! ##

This is my problem :-

- I have set a form frmSplash as the startup form instead of sub Main.
- This means I dont create an instance of it myself at startup.. its automatically created.
- I have a timer on frmSplash set to 3000 ms interval - and here is its tick event :

Private Sub tmrStartup_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrStartup.Tick
Dim frmParent As New frmParent
frmParent.Show()
Me.Close()
End Sub

Now what I thought was that after the first tick at 3sec it would create an instance to frmParent and show that then close itself(frmSplash)... but sadly what happens it that the "me.close" closes the whole app. Ive tried me.close before the "Dim frmParent As New frmParent" but same result.. the application closes and frmParent is closed.

What I want to happen is frmSplash should close and show frmParent.

Thanks for Looking.
Nov 20 '05 #1
2 1670
Can I suggest an alternative approach ...

Rather than have a form as the startup object, create a Sub Main and make
that the start object.

In Sub Main, create and show your splash form, and when it closes call
Application.Run() for your main form.

Better still, if you don't use a timer but let the splash screen return
immediately, you can carry on and perform initialisation whilst the splash
screen is up, and then close it when the longer of initialisation and three
seconds occurs.

HTH

Charles
"BuzzLight" <Bu*******@Domain.com> wrote in message
news:XZ***************@news-binary.blueyonder.co.uk...
This is my problem :-

- I have set a form frmSplash as the startup form instead of sub Main.
- This means I dont create an instance of it myself at startup.. its automatically created. - I have a timer on frmSplash set to 3000 ms interval - and here is its tick event :
Private Sub tmrStartup_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrStartup.Tick Dim frmParent As New frmParent
frmParent.Show()
Me.Close()
End Sub

Now what I thought was that after the first tick at 3sec it would create an instance to frmParent and show that then close itself(frmSplash)... but
sadly what happens it that the "me.close" closes the whole app. Ive tried
me.close before the "Dim frmParent As New frmParent" but same result.. the
application closes and frmParent is closed.
What I want to happen is frmSplash should close and show frmParent.

Thanks for Looking.

Nov 20 '05 #2
Cor
Hi BuzzLight,

Reading the text from Charles I changed my splashform a little bit.
(I was using showdialog)
I hope this helps?

Cor
\\\form1
Private Sub Form1_Load(ByVal sender _
As Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim frm As New Form2
frm.Show()
End Sub
///
\\\form2
Private WithEvents timer1 As New Windows.Forms.Timer
Private Sub Form2_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = "High I Am Here"
Me.ForeColor = Color.White
timer1.Enabled = True
timer1.Interval = 125
Me.BackColor = Color.CornflowerBlue
Me.Opacity = 1
Me.TopMost = True
Me.Text = "Splash"
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles timer1.Tick
Me.Opacity -= 0.01
If Me.Opacity = 0 Then
timer1.Enabled = False
Me.Close()
End If
End Sub
///
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom | last post by:
Hi all In winform application I am trying to start 2 forms I am trying to show the 2nd winform on a separate thread. using Thread mainapp = new Thread(new ThreadStart(loadmainscm)); ...
11
by: K E Senthil Kumar | last post by:
Hi, I have created an application which uses a SQL server database. I created a mainform which retreives all the customers. This takes about 3sec. I have created a splash screen too. I use a...
1
by: steve | last post by:
Hi All I want to display a splash screen when my windows application loads, to show sql server connection progress etc. First though I want to run some code to check for a valid program...
5
by: steve | last post by:
Hi All I have a form set as the splash screen in VB.net 2005 application properties How can I tell when it has or is closing, as I want to then run some licence checking code without the...
3
by: steve | last post by:
Hi All I have a VB.net 2005 App which has a form set as the Application splash screen in Project properties Another form is set as the startup form All works great until the splash screen...
2
by: Mika M | last post by:
Hi! My Windows Forms VB 2005 application has Splash Screen form specified in My Project/Application/Splash Screen. How can I close Splash Screen form programmatically when Startup form...
10
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show...
1
by: BRAHM | last post by:
I am using this code to set up the splash screen startup time. Protected Overrides Function OnInitialize( _ ByVal commandLineArgs As _ System.Collections.ObjectModel.ReadOnlyCollection(Of...
1
by: BRAHM | last post by:
I am using this code to set up the splash screen startup time. Protected Overrides Function OnInitialize( _ ByVal commandLineArgs As _ System.Collections.ObjectModel.ReadOnlyCollection(Of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.