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 6213485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:42:17+00:00 2026-05-24T06:42:17+00:00

In VS2010, targeting Framework 4.0, I have a UserControl which contains a TableLayoutPanel with

  • 0

In VS2010, targeting Framework 4.0, I have a UserControl which contains a TableLayoutPanel with an empty second row.

Is it possible to add items to this second row using the Windows Forms Designer, or do I have to do it all via code?

EDIT: In reply to Hans Passant’s comment, the linked question references a UserControl being used inside another control. I am asking a question about inherited controls.

I have created the following test code, where TestControl is a UserControl containing a TableLayoutPanel named “TableLayoutPanel1”:

Imports System.ComponentModel
Imports System.Windows.Forms.Design

<Designer(GetType(testDesigner))>
Public Class TestControl
End Class

Public Class testDesigner
    Inherits ControlDesigner
    Public Overrides Sub Initialize(component As System.ComponentModel.IComponent)
        MyBase.Initialize(component)
        Dim X As TestControl = CType(component, TestControl)
        EnableDesignMode(X.TableLayoutPanel1, "TableLayoutPanelX")
    End Sub
End Class

Creating the following class in a new file:

Public Class TestInheritedControl
    Inherits TestControl
End Class

creates a control which, when viewed in the designer, contained a TableLayoutPanel named “TableLayoutPanel1” which is not designer-editable. This is the situation described in my original question, which is not solved.

Creating a new UserControl, not inheriting from either of the previous UserControls, and then placing a TestControl into it creates an instance of TestControl with a Designer-editable TableLayoutPanel named “TestControl1.TableLayoutPanelX”.

Is there any way to make the TestInheritedControl class, shown above, Designer-editable?

  • 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-24T06:42:19+00:00Added an answer on May 24, 2026 at 6:42 am

    I just had to do something similar today. The way I worked around it is to use un-instantiated references in the base class, but do the actual instantiation on the inheriting class.

    You have to add a couple of steps to make everything fully plug-in, but it gives you the control you want. You will have to drop the TableLayoutPanel onto each inheriting control type, and in the constructor, set the base class’ version to the current instantiated version (after calling initializecomponents).

    This way, you can “design” it in the inheriting control, but use it programmaticly from the base control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application project being developed in VS2010 targetting Framework 4.0. I
In VS2010 I had a project targeting .NET Framework 4.0 and then had to
I have a component project build in VS2008 and targeting the .NET Framework 3.5.
I wrote a simple VS2010 WPF application which targeted .NET Framework 4 Client Profile
Using VS2010, .NET4.0, MVC3, EF4.1 Code-First I have this POCO entities: public class XBLContent
I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then
I'm using VS2010 Beta 2, I have a Complex Type called Address with the
Intellisense popup in VS2010 is driving me crazy. I can only see 9 items
I have installed VS2010 and MVC2 and testing a simple form using tinyMCE. When
This fails on VS2010 RC LINQ-to-SQL with the InvalidOperationException Stored procedures cannot be used

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.