Help to create a usercontrol VB.NET

Apostolos Doudakmanis 161 Reputation points
2026-09-15T14:56:30.37+00:00

I am trying to create a "Group" user control—similar to a GroupBox—that features a title and a "Launcher" button next to the title, while allowing me to add any other desired controls to the main body of the group later on the form.

The title and the Launcher button should be grouped together and positionable at either the top or the bottom of the group, depending on my preference.

The remaining empty body area should allow me to place other controls on the form.

I have built it, but while the controls appear during design time, they disappear at runtime.

+------------------------------+

| Title [Launcher] | ← headerPanel (Top)

+------------------------------+

| |

| _contentPanel |

| |

+------------------------------+

OR

+------------------------------+

| |

| _contentPanel |

| |

+------------------------------+

| Title [Launcher] | ← headerPanel (Bottom)

+------------------------------+

Developer technologies | VB
0 comments No comments

Answer accepted by question author
Tom Tran (WICLOUD CORPORATION) 5,945 Reputation points Microsoft External Staff Moderator
2026-09-16T02:58:11.21+00:00

Hi @Apostolos Doudakmanis ,

What you are seeing may be related to how the custom UserControl handles its inner content area at design time and runtime, rather than to VB.NET itself.

In WinForms, controls can appear inside a custom control in the designer but still be missing when the application runs. This can happen if the controls placed inside the body panel are not saved into the generated form code, are added to the wrong parent container, or are removed or covered by the control's runtime layout.

To assist you better, could you please share:

  1. The target framework shown in the project properties, such as .NET Framework 4.8, .NET 8, or .NET 9.
  2. The code for the custom UserControl, including its Designer file.
  3. Any custom designer class used by the control.
  4. The relevant section of the form's .Designer.vb file where one of the disappearing controls is created and added.

The generated form code is especially useful because it shows whether Visual Studio is adding the control to the intended content area. Please remove any private project information before posting the code.

Once I can review those sections, I can help determine whether the issue is related to how the control is being saved, how the child controls are being parented, or how the layout is handled at runtime.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.