473,406 Members | 2,439 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,406 software developers and data experts.

sluggish splash screen

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 later.

Naturally recalling the application, the response is adequate

I have 10 classes in my project. Some small, none really huge. And another form

public class frmQCLoader : System.Windows.Forms.For
{
private System.Windows.Forms.DataGrid QCDG
private System.Windows.Forms.Button btnLoad
private System.Windows.Forms.Button btnInstall
... 2 of my classe
more native control

public frmQCLoader(

// Required for Windows Form Designer suppor
frmStatic.ShowStaticForm(); // SO ITS FIRST in the STAC

Is is likely the considerable delay is called by instantiating my classes for referencing throughout the for
and if so, is there a way to around this ? Thank

Nov 15 '05 #1
3 2245
Hi Andrew,

If you look in the archives you will see some simples ways of doing a splash
screen, below you will find the code I'm using and it works fine.
You can say that the trick is show the form in the Main() method. this
assure that the splash is shown as early as possible

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
//************* The main form START CODE *************////////

public Form1()
{
InitializeComponent();
//This is the reason of the splash screen, to load data in the back :)
DataProvider.LoadData();
splashform.CloseIt();
}
[STAThread]
static void Main()
{
splashform = new splash();
Application.Run(new Form1());
}
//************* The main form END CODE *************////////

Below is the code for the splash window, only the code important to it is
shown, the rest is the regular code found in a windows form

//************* The splash form START CODE *************////////
DateTime time;
public splash()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

// Show the splash screen
Show();
//To know how many time it has been displayed
time = DateTime.Now;

Application.DoEvents();
}

public void CloseIt()
{
TimeSpan T = DateTime.Now - time;
// if the method was closed before a specific amount of time, wait for the
different and later close the form.
if (T.Milliseconds<3000)
System.Threading.Thread.Sleep(3000-T.Milliseconds);
this.Close();
}
//************* The splash form END CODE *************////////

"andrewcw" <an******@acw.com> wrote in message
news:80**********************************@microsof t.com...
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 later.
Naturally recalling the application, the response is adequate.

I have 10 classes in my project. Some small, none really huge. And another form.
public class frmQCLoader : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid QCDG;
private System.Windows.Forms.Button btnLoad;
private System.Windows.Forms.Button btnInstall;
... 2 of my classes
more native controls

public frmQCLoader()
{
// Required for Windows Form Designer support frmStatic.ShowStaticForm(); // SO ITS FIRST in the STACK

Is is likely the considerable delay is called by instantiating my classes for referencing throughout the form and if so, is there a way to around this ? Thanks

Nov 15 '05 #2
The problem is more than likely due to the fact that your app is loading and
initializing multiple modules. All that adds up to a slow splash screen.

Have you looked into delayed/demand loading of your modules? (i.e. loading the
module when first accessed). Look in MSDN documentation for details on how to
do this.

If that doesn't work, you may have to simply create a stub app that simply
displays your splash screen and then executes your actual app? I've done this
in previous projects -- a little cumbersome, but it provides *instantaneous*
response to the user.

andrewcw wrote:

moving the call for splash screen to main does seem to help a little bit - I went from about 12 seconds for splash screen to display to 9 seconds with a 1 GHZ 256 MB RAM PC.


--
Bret Pehrson
mailto:br**@infowest.com
NOSPAM - Include this key in all e-mail correspondence <<38952rglkwdsl>>
Nov 15 '05 #3

Hi Andrew,

Does the community's reply make sense to you?

If you still have anything unclear, please feel free to post, I will help
you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4

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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
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...
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...
0
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,...

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.