Retreving a control in a parent form when the current form is in a tab control

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?

Optikal
12-21-2003, 10:46 AM
uhhh, how can a tab "contain" a form?

RanmaGuy
12-21-2003, 11:34 AM
Dim subform As New subform

maintab.AddTab(subform, "This is a tab")

That adds a tab to the maintab that contains the subform in it.

BTW, I am using the LumiSoft WTab control. It's different than the standard tab control where I think you have to add things via panels.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum