Retreving a control in a parent form when the current form is in a tab control
How do I get a control of a parent form of a form that's embedded in the parent from's tab control?
To simplify what I am talking about, the layout looks like this:
+ Parent Form named "mainform"
- combo box control named "search"
- Tab control named "maintab"
> One of the tabs have a form named "subform"
------------------------
I want to access the combo box control from the subform.
-------------------------
I've tried the following:
Code:
Dim ctl As Control
For Each ctl In Controls
If ctl.FindForm.ParentForm.ParentForm.Controls.GetType Is _
GetType(DotNetWidgets.FlatComboBox) Then
If ctl.Name = "search" Then
ctl.Enabled = False
End If
End If
Next
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe