Question on forum loading
hey. So in my program I have it set to download a file when the program loads. I made a method and i put that in the Form_load routine. The program is that, it starts the download before the form is even visible. So since its downloading the file, the forum doesnt end up showing up until the file is done downloading. I tried to use 'If me.visible = true', but that still had the same result. I also tried the 'Visibility Changed' Method. Any ideas?
John
Re: Question on forum loading
The quick and easy method is application.doevents, or you could download it on a seperat thread
Re: Question on forum loading
how do i do it with application.doevents?
Re: Question on forum loading
Just put it in the form load before you start downloading.
Re: Question on forum loading
hmm that didnt seem to work, can you tell me how to do the thread idea?
Re: Question on forum loading
Hmm that's odd, I thought you could just use application.doevents, I tried it and it'll work if you put me.show before it. Your probably better off using a thread though. Here's a link that explains how to do it:
http://www.devx.com/getHelpOn/10MinuteSolution/20365
Re: Question on forum loading
The form does not become visible until the Load event handler completes. You should use the Activated event instead, which is raised after the form becomes visible. Unlike the Load event, the Activated event can be raised multiple times for the same form, so you would need a Static or class-level variable to indicate whether this was the first time the event had been raised.
Re: Question on forum loading
An easier way yet is to simply call "Me.Visible = True" at the beginning of the load event, and perhaps doevents will also be required after this, but testing with that and a message box, the form is visible when the message box appears.
P.S Jm, whats with you disabling pm's and emails
Re: Question on forum loading
i think starting it in a new thread at form load is the right course of action.
New thread to run the download will make the form loading and file downloading execute in parallel
rgds