|
-
Jan 13th, 2006, 04:34 PM
#1
Thread Starter
Addicted Member
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
-
Jan 13th, 2006, 04:38 PM
#2
Re: Question on forum loading
The quick and easy method is application.doevents, or you could download it on a seperat thread
TPM
Add yourself to the VBForums Frappr Map!!
-
Jan 13th, 2006, 04:44 PM
#3
Thread Starter
Addicted Member
Re: Question on forum loading
how do i do it with application.doevents?
-
Jan 13th, 2006, 05:28 PM
#4
Re: Question on forum loading
Just put it in the form load before you start downloading.
TPM
Add yourself to the VBForums Frappr Map!!
-
Jan 13th, 2006, 05:33 PM
#5
Thread Starter
Addicted Member
Re: Question on forum loading
hmm that didnt seem to work, can you tell me how to do the thread idea?
-
Jan 13th, 2006, 05:45 PM
#6
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
TPM
Add yourself to the VBForums Frappr Map!!
-
Jan 15th, 2006, 08:40 AM
#7
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.
-
Jan 15th, 2006, 09:05 AM
#8
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
-
Jan 15th, 2006, 11:56 AM
#9
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|