Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDI child forms loading one another

Posted on 1999-06-25
13
Medium Priority
?
144 Views
Last Modified: 2010-05-02
I'm working on the MDI application.
When trying to load one child form from within another with filling its controls with some data (which is time consuming activity), I encounter big problem. I want to first fill another form with data and then show it (as fast as it's possible), but this goes in two steps which I don't know how to control.
I'm sure problem is in multitasking. When second form enters Avtivate, first one probably continues to execute, and that makes impression of very slowly and gradualy drawing the second form.
I hope I made it clear enough.
Anyone has idea how to solve this problem?

Apolo.
0
Comment
Question by:ekc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 

Expert Comment

by:reflex16
ID: 1519846
load the new form
make the form .visible = false
transfer the data
the make the form .visible = true
0
 
LVL 5

Author Comment

by:ekc
ID: 1519847
I tried that in several ways but it won't work.
When execution enters Activate event, then starts dwawing of the form NO MATTER is visible property true or false.
First Windows draws caprion and border, then stops drawing (doing something else), and finnaly continues with rest of the form.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1519848
In VB6, set property frmMDI.AutoShowChildren = False
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:ameba
ID: 1519849
Property AutoShowChildren As Boolean
Returns/sets a value that determines whether MDI child forms are displayed when loaded.
----------------------------------------

Put this line at the beginning of Activate event.
Sub Form_Activate()
   Refresh ' this will allow painting the whole form
   ' now fill lists, etc.

0
 
LVL 5

Author Comment

by:ekc
ID: 1519850
Bravo Ameba!
But this time there is one thing. In this case (AutoShowChildren=false), Activate is never executed!! Try, you'll see. This means that instead of Refresh in this event, I had to put visible=true (refresh doesn't help in this place either) in the calling function to see the form.
Do you have some explanation of this behaviour?
Anyway, you got your points once more, no doubt about that.
Reflex 16, thanks for trying, but ameba's solution was complete. Please, unlock my question to grade him.

Apolo.

0
 
LVL 15

Expert Comment

by:ameba
ID: 1519851
>Activate is never executed!!
Sometimes, we cannot predict the order of events or what will be triggered. (not great explanation, huh)

>you got your points once more
Thanks, ekc, I hope I'll get them
You'll have to reject reflex16's answer first /he can't unlock it/, then I'll lock your question.
0
 
LVL 15

Accepted Solution

by:
ameba earned 300 total points
ID: 1519852
Thanks for your points
0
 
LVL 5

Author Comment

by:ekc
ID: 1519853
> Sometimes, we cannot predict the order of events or what > will be triggered. (not great explanation, huh)

Do you realy think this? We always can "predict" program flow. In fact that isn't prediction, that is expected process. Do you know old joke about hardware enginer, system administrator and software developer driving in a car on the mountain road... In one moment they lose control over the vehicle, get off the road through trees, bushes and finally stop on the edge of the dangerous cliff! What to do?
HW enginere: No problem dudes, we can carefuly get out, pull up the car with cord, fix it with our tools, and continue our trip!
Admin: That's to complicated my friend. Let's use celular to call mechanics and pay them to fix our car. Meanwhile we could use taxi to get to nearest motel, eat something, go to sleep. Tommorow morning, our car will be in front, waiting for us to hit to roads.
Developer guy: Why don´t we bring car to the top of that hill again, push it and see is it gonna be the same?

Regards ameba and thank you once more.

Apolo.

P.S. For that "predicting of the program execution" this time you got B minus! :)
0
 
LVL 15

Expert Comment

by:ameba
ID: 1519854
:-) for the joke. I love jokes about programmers.
:-( for B minus. But, at least I got some points (in Q: 'Graphics in VB project' I didn't :)

>We always can predict
No, I was serious. I met many exceptions/surprises when predicting events - RichTextBox, ListViev, Forms. I actually copied sentence "Sometimes, we cannot ..." from my other answer/workaround.
But, I agree this is not explanation. :)
0
 
LVL 5

Author Comment

by:ekc
ID: 1519855
> But, at least I got some points (in Q: 'Graphics in VB project' I didn't :)

Why is that?? Why didn't you get points?

Apolo.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1519856
You accepted the answer proposed by the other expert.
Point system/grading is a bit complicated and can be confusing. You'll get used to it. Don't worry!
0
 
LVL 5

Author Comment

by:ekc
ID: 1519857
Ooops.
Sorry ameba, my mistake. Next time you'll get 50 points more, ok? :)

Apolo.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1519858
:)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

662 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question