Link to home
Start Free TrialLog in
Avatar of DataSol
DataSol

asked on

Using a common MDI form both for standard call and for modal call

Let's say I have form A, that is an MDI form. Let's say it's used to handle customers.
Now I want to have my main menu able to call that A form, and keep it open while I open my... let's say Invoice form where I want to show form A, but in vbModal way (of course if you have formA.mdichild = true then you can't show it vbModal).
The problem is that if I copy the form with a:

Dim B as new FormA

I can't modify the MDIChild property, as it is read-only in run-time.
So, is there a way, different from saving the file and changing the form name to show it both as MDI and as Modal?

Thank you
Avatar of rspahitz
rspahitz
Flag of United States of America image

The only way I can think of is to dynamically copy the contents of the child form into a standard form which can then be show modally.  The copy would require moving each object to the proper location and making it visible.  This part is easy, but may be a bit slow if you have a lot of controls and have to unload it each time (rather than load it just the first time then leave it hidden.)
Avatar of DataSol
DataSol

ASKER

Rspahitz: ok, I can dynamically create the objects on the new form, but what about the code related to events?
ASKER CERTIFIED SOLUTION
Avatar of rspahitz
rspahitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
Hi DataSol,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rspahitz's comment(s) as an answer.

DataSol, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange