Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: MDI Application issues


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jan 23, 2017 9:38 AM Last Post By: Peter Below
Toby Dobbs

Posts: 77
Registered: 9/24/16
MDI Application issues  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 23, 2017 3:17 AM
Hi,

I have an MDI application in which I would like to be able to run multiple instances of a form. When I do this, it appears to work okay for the most part but with some errors regarding certain global paramaters. Is there a safe way of creating such an application style or is this inherent?

Additionally, should I use FormActivate or FormCreate when instantiating global variables in an MDI application?
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: MDI Application issues  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 23, 2017 9:38 AM   in response to: Toby Dobbs in response to: Toby Dobbs
Toby Dobbs wrote:

Hi,

I have an MDI application in which I would like to be able to run
multiple instances of a form. When I do this, it appears to work okay
for the most part but with some errors regarding certain global
paramaters.

The form variable the IDe creates for you can of course only hold one
instance of the form. If you create more than one instance of a MDI
child form class you should not use the variable at all, best delete it
from the source code. Do not autocreate MDI child forms at all, create
them in code. Do not use global variables to hold these form instances,
use the main form's MDIChildren property to enumerate the MDI child
forms in existence, and the main form's ActiveMDIChild property to
access the active MDI child window (beware: this property can be nil if
no child form exists!).

Additionally, should I use FormActivate or FormCreate when
instantiating global variables in an MDI application?

To create a default set of MDI child forms at application start best
use the main form's OnCreate event.

--
Peter Below
TeamB

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02