splash screen help please!

  • Thread starter Thread starter K E Senthil Kumar
  • Start date Start date
K

K E Senthil Kumar

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.

Any suggestions.

senthilkumar
 
Senthil,

Just this in the load sub of form1 is the shortest way of showing a handling
a splash screen I can think about. In this is not any error handling done,
so it will never be real just a here in this message types sample snippet.

\\\
dim frm2 as form2
frm2.show
datatadapter.fill(mydataset)
frm2.close
///

I hope this helps?

Cor
 
Herfried,

In this message is written "Should be" I disagree that very much, there are
hundreds of other methods which will give the same result with less work.
(Not denying that there are situation where a threaded form can help).

The method I showed is as well for dataaccess in the resource kit in a more
extended format. Therefore my question why you show such a difficult method
that "should" be used for a splash screen that normally would show so short,
that id does not give the time to read what is written on it before it is
closes again.

Cor
 
Cor Ligthert said:
\\\
dim frm2 as form2
frm2.show
datatadapter.fill(mydataset)
frm2.close
///

Notice that the user will be able to click the main form and thus send the
splash screen to back, if the form is already visible, or the main form
won't be visible at all until the splash screen closes and loading is done.
 
Herfried,
Notice that the user will be able to click the main form and thus send the
splash screen to back, if the form is already visible, or the main form
won't be visible at all until the splash screen closes and loading is
done.
And what can be the problem than, (Think about it its loading of a dataset
or other dataclasses while the form is 3 seconds open, you can reach in that
time the close button of course, however most users don't).

Cor
 
Hi All,

Thanks for your replies. I found a solution to my problem:
Create this sub and add it in the form load event. but before loading the
dataset. We can increase the value of 3000 to more if it takes long for the
dataset to fill.

imports system.threading

Private Sub LoadSplash()
Dim m_frmSplash As New frmSplash
m_frmSplash.Show()
Application.DoEvents()
Thread.Sleep(3000)
m_frmSplash.Close()
End Sub

Senthil Kumar
 
Senthil,

Do you look to the answers in this newsgroup.

That threading.thread.sleep with doEvents sample as you use it, is real a
very bad implementation to keep the program active and show the form.

You use now exactly the same sample as I gave you, only with one application
do events in it and let the program sleep 3 seconds even when the wait time
is half a second. How you synchronize that with the reading is a riddle.

I think it has no sense to give you the right implementation with
threading.sleep and doevents, because it seems you do not read this messages
anyway.

Cor

"K E Senthil Kumar"
...
 
Hi Cor,

Not to offend, but i do read the answers. But the code you mentioned, doesnt
solve the problem, still the same behavious was seen. So i found another
example of a splash screen wherein this code was given.

To be honest with you, i am new to .net , dont know about threading, etc.
Since it really didnt do anything disatrous, i kind of let it go.

About the timing, i increased the value 3000 up and and down and thats the
setting it works,

Thanks all for your comments.

senthil kumar
 
Not to offend, but i do read the answers. But the code you mentioned,
doesnt solve the problem, still the same behavious was seen. So i found
another example of a splash screen wherein this code was given.

To be honest with you, i am new to .net , dont know about threading, etc.
Since it really didnt do anything disatrous, i kind of let it go.

About the timing, i increased the value 3000 up and and down and thats the
setting it works,

Than you can at least tell us why it is not working, so we can learn from
that, the way you do it now is only confusing me.

Cor
 
Cor,

Sorry, why it doesnt work, i dont know. Like i said, when the code worked
like what i wanted, i left the issue at that. please understand, i am new to
..Net

Senthil kumar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top