473,654 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

## 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.EventArg s) 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(frmSplas h)... 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 1689
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*******@Doma in.com> wrote in message
news:XZ******** *******@news-binary.blueyond er.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.EventArg s) 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(frmSplas h)... 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(ByVa l sender _
As Object, ByVal e As System.EventArg s) _
Handles MyBase.Load
Dim frm As New Form2
frm.Show()
End Sub
///
\\\form2
Private WithEvents timer1 As New Windows.Forms.T imer
Private Sub Form2_Load(ByVa l sender As Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Label1.Text = "High I Am Here"
Me.ForeColor = Color.White
timer1.Enabled = True
timer1.Interval = 125
Me.BackColor = Color.Cornflowe rBlue
Me.Opacity = 1
Me.TopMost = True
Me.Text = "Splash"
End Sub
Private Sub Timer1_Tick(ByV al sender As System.Object, _
ByVal e As System.EventArg s) 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
20623
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)); mainapp.Start(); //where
11
1591
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 module to open the splash screen and then the mainform. The splash screen opens up, mainfrom load, but still it takes 3sec for the data to show up. What i want is while the mainform loads, i want to show the splash screen.
1
1189
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 licence. If not found then the program would close How is the best way to do this
5
6398
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 splash screen interfering with msgboxes which may need to be displayed if the licence is invalid or missing I have tried in the splash form's formclosing event but it does not fire
3
2325
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 closes or I close it to allow error messages to be displayed from Licence or Database checking errors
2
2347
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 (specified in same place) causes error when it is loading and it cannot open database connection for example? Now error message will be below Splash Screen form, and it causes problem how to read error message and close it.
10
22363
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 progress of these tasks on a label on the SplashScreen form. Once this is completed ok, the splash screen should close and the login form should be displayed. A successful login closes that form and shows the main form.
1
1563
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 String) _ ) As Boolean ' Set the display time to 5000 milliseconds (5 seconds). Me.MinimumSplashScreenDisplayTime = 5000 Return MyBase.OnInitialize(commandLineArgs) End Function
1
3051
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 String) _ ) As Boolean ' Set the display time to 5000 milliseconds (5 seconds). Me.MinimumSplashScreenDisplayTime = 5000 Return MyBase.OnInitialize(commandLineArgs) End Function
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.