473,395 Members | 1,763 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,395 software developers and data experts.

Splash Screen

Howdy folks,
How would one go about making a splash screen (message appearing while main
program loading) in c#
cheers in advanced

Steve
Dec 22 '05 #1
4 9032
In your main form constructor, hide the main form.
Create your splash screen form instance and show it with Form.Show()
(not ShowDialog)
Continue with your initialisation code.
When your code is complete, close the splash screen with Form.Close()
and probably dispose it as well.
Show the main form again with this.Show()

You could also do it in the main static method. Show slash form,
initialise, show main form.

Thats the theory anyway!

Steven Nagy

Dec 22 '05 #2
Here's an example. The splash form is made transparent with a bee, so
when it loads, only the bee is visible. Then a timer, in frmSplash,
will close the form after 1375 ms. The bee will "fly" away to the upper
left corner and finally disappear.

However, is there a better way to animate the bee than my example?

The code in frmSplash:

private void timer1_Tick(object sender, System.EventArgs e)
{
this.Left = 400;
this.Top = 300;
this.Left = 375;
this.Top = 275;
this.Left = 350;
this.Top = 225;
this.Left = 300;
this.Top = 200;
this.Left = 250;
this.Top = 150;
this.Left = 200;
this.Top = 100;
this.Left = 100;
this.Top = 75;
this.Left = 50;
this.Top = 10;
this.Left = 0;
this.Top = 0;
Close();
}

private void frmSplash_Load(object sender, System.EventArgs e)
{
timer1.Enabled = true;
}

And in frmMain:

[STAThread]
static void Main()
{
///start splash-form for application
Application.Run(new frmSplash());

///start main-form
Application.Run(new frmMain());
}

Me.Name

Dec 22 '05 #3
Hi,

If you google you will find several examples of a splash screen , this
question is posted here on a regular basis
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Steve" <sg*******@clear.net.nz> wrote in message
news:43********@clear.net.nz...
Howdy folks,
How would one go about making a splash screen (message appearing while
main program loading) in c#
cheers in advanced

Steve

Dec 22 '05 #4
Hi,

[STAThread]
static void Main()
{
///start splash-form for application
Application.Run(new frmSplash());

///start main-form
Application.Run(new frmMain());
}


What happens if frmMain loads before the timeout? , how does it close the
splash?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Dec 22 '05 #5

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

Similar topics

2
by: Bill | last post by:
Problem 1) Any ideas on how I would get a splash screen to appear for a certain amount of time when I open a database - it's to display a text based disclaimer message. I know about message...
3
by: andrewcw | last post by:
I implemented the simplest of splash screens ( static and on its own thread ). But it seem that when first called maybe 8 seconds elapsed before it showed up, the main form follows several seconds...
14
by: SStory | last post by:
I am trying to make a splash screen for my vb.net app. It is an mdi app. including the splash code produces wierd results. not inluding makes things fine. Also have tried loading the splash...
2
by: Joe Cool | last post by:
Using VB in VS2005. 2005 has a new way to implment a spash screen that alleviates the need for hardly any code. But I have found that when a GUI that has a splash screen is run as a scheduled task,...
1
by: Ken Allen | last post by:
I am developing a small utility program that must perform a considerable amount of 'background' or 'research' work before it can display any user interface. In general it can take 3-15 seconds to...
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...
2
by: will_456 | last post by:
In vb2005 Express: In My Project Application Splash Screen I have selected my splash screen form. The form opens on project startup but closes immediately before anyone would have time to read...
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...
4
by: Gaz | last post by:
I am having a bit of a problem getting my application to work properly. RIght here is my problem... WHen my C# windows app loads up the start form, i create a new thread and show the splash...
2
by: Newbie | last post by:
Hi, In the application properties of my vb.net 2008 project I have set one of my forms to be the splash screen. How do I increase the time the splash screen is displayed for. It vanishs to...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.