RanmaGuy
12-20-2003, 11:04 PM
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:
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
-------------------------
Any pointers?
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:
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
-------------------------
Any pointers?