Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Retreving a control in a parent form when the current form is in a tab control


Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2003, 12:04 AM
RanmaGuy RanmaGuy is offline
Newcomer
 
Join Date: Dec 2003
Posts: 2
Default 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
-------------------------

Any pointers?
Reply With Quote
  #2  
Old 12-21-2003, 11:46 AM
Optikal's Avatar
Optikal Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

uhhh, how can a tab "contain" a form?
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #3  
Old 12-21-2003, 12:34 PM
RanmaGuy RanmaGuy is offline
Newcomer
 
Join Date: Dec 2003
Posts: 2
Default

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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multi connections, one port? burningodzilla Communications 5 08-02-2005 06:04 PM
Datagrid control Beginner General 7 01-02-2004 12:37 PM
disable print preview from xlDialogPrint w_seyller Excel 9 12-11-2003 12:20 PM
Add Control in Form at Runtime - No Control Array Purdue2379 General 10 03-28-2003 05:23 PM
WinSock vbsupernewbie Communications 1 09-12-2001 11:20 PM

Advertisement:





Free Publications
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
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->