Quick Pop-up Splash Screens

  • Thread starter Thread starter Greg Smith
  • Start date Start date
G

Greg Smith

I have some applications that are slow loading and some of my users keep
clicking away until they see something.

Can anybody point me to some examples of quick loading splash screens and
tips on tweaking up the load speed of an application?


Any help is greatly appreciated.
 
Greg,

You will need to be more specific about tweaking up the load speed of an
application. What is it that you are doing in your app on startup that is
causing the long load time? It's a very general question, to say the least.

Also, if you want a splash screen, you are going to have to move
whatever processing you are doing before your window loads to another
thread, so that the splash screen can repaint itself properly if needed (you
don't need it to move or anything like that, but it won't repaint itself
properly if you don't process the message loop, something you can't do if
your processing is occuring on the UI thread).

Hope this helps.
 
Hi,

Do a search in google for "splash screen" you will find several solutions,
below is the code I use.


public class splash : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;

DateTime time;
public splash()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
Show();
time = DateTime.Now;

Application.DoEvents();
}

public void CloseIt()
{
TimeSpan T = DateTime.Now - time;
if (T.Milliseconds<3000)
System.Threading.Thread.Sleep(3000-T.Milliseconds);
this.Close();
}
}



// In the main form:

static splash splashform;

[STAThread]
static void Main()
{
splashform = new splash();
Application.Run(new Form1());
}



public Form1()
{
try
{

DataProvider.PreLoadData();
splashform.CloseIt();

}
catch( Exception e)
{
MessageBox.Show( e.Message + " In Main ");
}
}


Cheers,
 
Hi,

Regardign the code, I do not need the refresh the UI, if you need so you
have to use a thread , and then you do not need the Application.DoEvents()
call


cheers,
 
Thanks for the info.

I am chrashing on:

DataProvider.PreLoadData();

What namespace is that in?
 
Hi,


Mine :)

You are not crashing there, it does not compile, that's the method that
load the data in my app while the client sees the splash


cheers,
 
Back
Top