|
-
Jun 29th, 2004, 11:19 AM
#1
Thread Starter
Hyperactive Member
How do I reference a control in an MDI childform
I have a control in an MDI child form, named myControl
From the parent window, how can I reference myControl?
I have tried Me.ActiveForm.Controls("myControl")
but that doesn't work, any ideas?
-
Jun 29th, 2004, 11:25 AM
#2
Hyperactive Member
The best way is to create your child forms by declaring them like this:
VB Code:
Private Child1 As New Form2 'Form level variable....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Child1.Show
Dim sCtrlName As String
sCtrlName = Child1.myControl.Name
MessageBox.Show(sCtrlName)
End Sub
-
Jun 29th, 2004, 11:40 AM
#3
Thread Starter
Hyperactive Member
Thanks Cyberhawke,
That works perfectly!
-
Jun 29th, 2004, 11:43 AM
#4
Hyperactive Member
No problem, glad I could help
-
Jun 29th, 2004, 02:22 PM
#5
Thread Starter
Hyperactive Member
One question on this though, how do I make sure I am calling the Active MDI form?
-
Jun 29th, 2004, 04:09 PM
#6
Hyperactive Member
I'll have to play around with that and get back to you, I should have something by tomorrow.
-
Jun 29th, 2004, 05:06 PM
#7
Hyperactive Member
-
Jun 30th, 2004, 03:45 AM
#8
Thread Starter
Hyperactive Member
Thansk Cyberhawke,
I am cooking now with the MDI, although still having a few other probs. Check my latest post.
Thanks
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
|