|
-
Dec 1st, 2005, 07:06 PM
#1
Thread Starter
Addicted Member
[RESOLVED] On form load problems
Hi all,
I'm currently writing a program where one form loads another. The next form does stuff, but it won't display until it finishes doing the stuff, but I need it to appear before, since it tells you what it's doing.
Example:
"form1", onclick of button "1":
Code:
form1.visible = false
load form2
form2.visible = true
unload form1
"form2", Form_load event:
Code:
<DoSomeStuff>
graphic1.visible = true
<DoSomeStuff>
graphic2.visible = true
What should happen is that form 1 dissapears, form 2 appears, and as each "<DoSomeStuff>" happens, the user can see each graphic load.
What actually happens is, you click the button "1", the form pauses for a sew seconds (as the actions in the Form_load of form 2 are being carried out), and then form 2 loads, with all the graphics in place.
I thought I could solve it by putting all the code from form 2's Form_load event into a seperate function, I.e.
"form2", Form_load event:
"form2", Private Function SecondBit:
Code:
<DoSomeStuff>
graphic1.visible = true
<DoSomeStuff>
graphic2.visible = true
But it still had the same problem. I've also tried using the "sleep" thingy and a timer in form_load to give it time to load the form before executig the code, but it just adds to the loading time.
So, how would I go about doing this?
-
Dec 1st, 2005, 07:19 PM
#2
Re: On form load problems
Rather than Form_Load events, you can use Form_Activate instead
-
Dec 1st, 2005, 07:23 PM
#3
Lively Member
Re: On form load problems
i really don't fully understand what your app is trying to do... but, if your using a command button to load another form, you should unload the first form... for example...
"on click"
unload form1
form2.show
-
Dec 1st, 2005, 07:36 PM
#4
Re: On form load problems
You don't have to, as the Load event re-initializes everything. I hide forms so that the values stay the same when it is re-shown.
-
Dec 1st, 2005, 08:19 PM
#5
Thread Starter
Addicted Member
Re: On form load problems
Works perfectly dglienna, thank you
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
|