Apologies in advance if this is Kindergarten stuff, but I'm really struggling on this one...
I'm developing an app with an MDI Form as it's main window. On startup, I dynamically create a varying number of MDIChild forms, dependent on data stored elsewhere. I use the following code within the FORM_LOAD section of my MDIForm:
Dim a As Form
For Counter = 0 To Form2.List1.ListCount - 1
Set a = New CallGroupForm
a.FormNumber = FormNumber
FormNumber = FormNumber + 1
a.Visible = True
Next Counter
(a.FormNumber and a.Visible are used for other purposes, and are not really part of the problem).
Within each MDIChild that is generated in this way, I can control each window form from within itself using the 'Me.' predicate.
My problem is, how do I identify and control one of the form instances from code external to the individual form? For example, using code elsewhere in the app, I need to unload a single instance of the Form, leaving all others in place. Unfortunately, the FormName for every instance is the same - 'CallGroupForm, and trying to change the FormName at runtime returns an error.
Do I have to do something clever with the WindowHandle, or is there a simpler solution.
Thanks in advance.
Chris Lawton
Chris@Lawton.net
I'm developing an app with an MDI Form as it's main window. On startup, I dynamically create a varying number of MDIChild forms, dependent on data stored elsewhere. I use the following code within the FORM_LOAD section of my MDIForm:
Dim a As Form
For Counter = 0 To Form2.List1.ListCount - 1
Set a = New CallGroupForm
a.FormNumber = FormNumber
FormNumber = FormNumber + 1
a.Visible = True
Next Counter
(a.FormNumber and a.Visible are used for other purposes, and are not really part of the problem).
Within each MDIChild that is generated in this way, I can control each window form from within itself using the 'Me.' predicate.
My problem is, how do I identify and control one of the form instances from code external to the individual form? For example, using code elsewhere in the app, I need to unload a single instance of the Form, leaving all others in place. Unfortunately, the FormName for every instance is the same - 'CallGroupForm, and trying to change the FormName at runtime returns an error.
Do I have to do something clever with the WindowHandle, or is there a simpler solution.
Thanks in advance.
Chris Lawton
Chris@Lawton.net