|
-
November 24th, 1999, 03:27 PM
#1
Selecting MDI Child forms
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...
-
November 24th, 1999, 03:55 PM
#2
Re: Selecting MDI Child forms
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
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|