Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 350495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:33:20+00:00 2026-05-12T11:33:20+00:00

I have a custom component, that contains a list of another components. If I

  • 0

I have a custom component, that contains a list of another components.

If I add a child component to the list, it shows up on the same level as the parent component in the document outline window.

How can I make it a subitem of the parent component? (similarly to e.g. TabPages that are subitems of a TabControl)

Here is my code:

Public Class SomeComponent
    Inherits Component

    Public Sub New(ByVal cont As IContainer)
        cont.Add(Me)
    End Sub

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
    <Editor("System.ComponentModel.Design.CollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", GetType(UITypeEditor))> _
    Public ReadOnly Property Items() As List(Of SomeOtherComponent)
        Get
            If _items Is Nothing Then
                _items = New List(Of SomeOtherComponent)
            End If
            Return _items
        End Get
    End Property
    Private _items As List(Of SomeOtherComponent) = Nothing

End Class

Public Class SomeOtherComponent
    Inherits Component

    Public Sub New()
    End Sub

    Public Sub New(ByVal cont As IContainer)
        cont.Add(Me)
    End Sub

    '...

End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:33:20+00:00Added an answer on May 12, 2026 at 11:33 am

    I have found the solution, here are the changes to the original code:

    <Designer(GetType(SomeComponentDesigner))> _
    Public Class SomeComponent
    ...
    End Class
    
    'this hides SomeOtherComponent from the component tray
    <DesignTimeVisible(False)> _
    Public Class SomeOtherComponent
    ...
    End Class
    
    Public Class SomeComponentDesigner
        Inherits ComponentDesigner
    
        Public Overrides ReadOnly Property AssociatedComponents() As System.Collections.ICollection
            Get
                If TypeOf (Me.Component) Is SomeComponent Then
                    Return DirectCast(Me.Component, SomeComponent).Items
                Else
                    Return MyBase.AssociatedComponents
                End If
            End Get
        End Property
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JTabbedPane with a custom tab component. That component contains a JLabel
O.K. Here's the situation... I have a custom mxml component that contains a couple
I have built a custom component that shows only a line. The line is
I have a custom listview row that contains a number of textView components. Instead
I have a VGroup in my application that contains several custom components of type
I have custom component that I can place in my layout file (XML) for
I have a custom component that is vertically longer than the screen height and
We have a custom JSF component that renders some buttons and a select box
I have a component where i want to display a custom jtooltip. That is
I have a custom composite control that contains a text box, some validators, as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.