Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Splash screen - Any advice?

2 views
Skip to first unread message

Sasha

unread,
May 20, 2003, 2:51:10 PM5/20/03
to
Hello,

Sorry if this was already posted... I need help with creating spalsh screens
and little progress windows that would be used during lenghty process,
indicating that the application has not locked up... Any ideas?

Thanks a lot!
Have a great day!

Sasha


Ignacio Machin

unread,
May 20, 2003, 2:29:23 PM5/20/03
to
Hi Sasha

You are right, it has been posted several times already

Anyway , this is the code I'm using
[STAThread]

static void Main()

{

splashform = new splash();

Application.Run(new Form1());

}

//Now in the constructor of Form1 you run your init code: and call the
CloseIt method of the splash window

public Form1()

{

try

{

DataProvider.LoadData();

splashform.CloseIt();

}

catch( Exception e)

{

MessageBox.Show( e.Message + " In Main ");

}

}

Splash is a winform class, defined as usual:

public splash()

{

InitializeComponent();

Show();

time = DateTime.Now;

Application.DoEvents(); //this is important as it allow the calling windows
to continue to loading

}

//Here I test if the windows has been visible for a required amount of time,
if not just sleep until I have.

public void CloseIt()

{

TimeSpan T = DateTime.Now - time;

if (T.Milliseconds<3000)

System.Threading.Thread.Sleep(3000-T.Milliseconds);

this.Close();

}

Hope this code help, if not take a look at
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22splash+screen%22&meta=group%3Dmicrosoft.public.dotnet.*
for a discussion of several ways of doing so

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Sasha" <ZseZc...@ua.fm> wrote in message
news:u6mfvivH...@TK2MSFTNGP11.phx.gbl...

Pierre Szwarc

unread,
May 21, 2003, 2:27:35 AM5/21/03
to
I had a similar problem (lengthy initialization in the main form), so I
launched the splash screen form in a separate thread. Search the
.dotnet.languages.vb group, that's where I posted a detailed description
(about a month ago, IIRC).
--
Pierre Szwarc
Paris, France
PGP key ID 0x75B5779B
------------------------------------------------
Science is true. Don't be misled by facts.
------------------------------------------------


"Sasha" <ZseZc...@ua.fm> wrote in message
news:u6mfvivH...@TK2MSFTNGP11.phx.gbl

Sudhakar sadasivuni

unread,
May 21, 2003, 6:52:47 AM5/21/03
to
You can decrease the loading time by creating application
image file using Ngen.exe. This image file will be cached
on client.

>.
>

0 new messages