November 24th, 1999, 02:27 PM
Is there an easier way to select an MDI Child form than searching through the forms collection (For each frm in Forms)? My app contains many Child forms all based on 1 particular form. At runtime I may DIM many new forms based on this one particular form. However, When I need to send a message to the form I need to search through the collection of forms. Is there an easier way? For instance is there any way that I can change the name of an MDI child form? This way I can access it directly?
Thanks,
Ed...
Aaron Young
November 24th, 1999, 02:55 PM
How are you creating the New Forms at Runtime?
If you use:
Dim MyNewForm As New Form1
Then you can access the new form using the Dim'd name, eg.
MyNewForm.Caption = "My New Form!"
Otherwise, you could create a Global Collection and Add teh New Form to the Collection Assigning it a Unique Key which you can use to Access it later, eg.
private MyCollection as new Collection
private Sub Command1_Click()
static iForm as Integer
Dim ANewForm as new Form1
iForm = iForm + 1
MyCollection.Add ANewForm, "NewForm" & iForm
With MyCollection("NewForm" & iForm)
.Caption = "NewForm" & iForm
.Show
End With
End Sub
Aaron Young
Analyst Programmer
adyoung@win.bright.net
aarony@redwingsoftware.com