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?
Printable View
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?
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
Thanks Cyberhawke,
That works perfectly!
No problem, glad I could help:afrog:
One question on this though, how do I make sure I am calling the Active MDI form?
I'll have to play around with that and get back to you, I should have something by tomorrow.
Got it faster than I thought :bigyello:
This should have all the code you need to get crankin with your mdi apps :thumb:
Thansk Cyberhawke,
I am cooking now with the MDI, although still having a few other probs. Check my latest post.
Thanks