PDA

Click to See Complete Forum and Search --> : 2 minor Form questions


JohnGH
Jun 20th, 2002, 08:41 AM
Hi,
I have to questions:

1 Is there a way to create a MDI child without having to use a
base form.
So what I do now:
Dim Document As New MYMDI()
Document.MdiParent = Me
Document.Show()
and what I'd want to use:
MYMDI.MdiParent = Me
MYMDI.Show()

2 How can I see if a form has allready been loaded?
somethin like:
If Form Is Loaded then
unload Form
EndIf


John

BryanJ
Jun 20th, 2002, 01:19 PM
Question 1.

The form MYMDI in your app is now a class. That is, it is a set of instructions that describes an object. It physically does not exist in memory.

What you need to do is now create a physical instant of your class - an object that actually occupies memory and has its own variables etc. - You do this using

dim frm as new MYDI()

frm is now a living breathing object that exists. - So you have to use the NEW statement that actually creates the object, in memory from the class.


Question 2.

if not (frm is nothing) then
frm.close
end if

The new gabbage collection system now cleans up any memory not used over a period of time.