Hey PPL!
Still creating my first serious .Net App and I think a thread will be the answer to this question but I dont how to apply it...![]()
I am creating an application that generates large Crystal Reports. The datasets for these reports take a considerable amount of time to create. During this time I show a small TopMost form with a simple wait message.
Recently I added an animated gif using a System.Windows.Forms.PictureBox control. I have done this to show the PC is still active and hasn't halted.
The problem is the processor is too busy making a dataset to animate the gif. All I get is 2 or 3 frames. I would suspect that placing the animation in its own thread would solve this problem. We could have nice animations and dataset generation all at once. BUT HOW?? Right now it looks like this:
Obviously without the call to generate the data the animation is displayed perfectly. With the data call we get a staggered, dodgy looking result.VB Code:
Dim frm as New frmWait .... frm.Show() Application.DoEvents 'Ensure paint has finished ... GenerateRptData() .... frm.Close()
I simply dont have enough threading experience to solve this problem. If I place a DoEvents in the data generation code it helps but still not as good as it could be. I need to somehow place the picturebox drawing code into its own thread. I think...
Any ideas guys, is multthreading the answer or am I way off.
Using: VS2003 & .Net 1.1
Thanks for your help in advance,
Matt.




Reply With Quote