Creating a reusable form using C# custom "User Control"

mjeschke 40 Reputation points
2025-06-30T23:29:09.53+00:00

I'm trying to create a layout / form that can be reused on other forms. I think I'm in the right to utilize a "User Control" (screen captures below). I populate the control with some components, save it, then try to bring it onto the main form.

I cannot find the User Control I built anywhere to add to the Form? I would expect to see it in the form designer toolbox?

I had a wonderful tutorial brought up in the .NET library but lost the page and cannot find it again. That aside, I don't think it was working as the tutorial explained.

User's image

User's image

Developer technologies | Windows Forms
{count} votes

4 answers

Sort by: Most helpful
  1. Susmitha T (INFOSYS LIMITED) 1,630 Reputation points Microsoft External Staff
    2025-07-01T11:16:25.7+00:00

    Thank you for reaching out.

    It looks like you're trying to create a reusable user control in C# and are having trouble seeing it in the Form Designer toolbox after building the project. This can happen if Visual Studio doesn’t automatically detect and load the control into the toolbox.

    Here are a few steps you can follow to add your custom User Control to the main form:

     Steps to Add a Custom User Control to the Toolbox:

     1. Build the Project:

    Ensure the solution is successfully built (Build > Build Solution).

     2. Open the Toolbox: Go to View > Toolbox in Visual Studio. 

    1. (Optional) Add a Custom Tab:

    Right-click in the toolbox > Add Tab (e.g., name it "Custom Controls").

    1. Add the Control Manually:

     Right-click inside the tab you created.

     Select "Choose Items..."

     Click Browse, navigate to the project’s bin\Debug (or bin\Release) folder.

     Select the .dll file of your project (where the control is built).

     Your User Control should appear in the list. Check it and click OK.

     5. The control should now appear in the toolbox and can be dragged onto your form.

    Let us know if the issue persists after following these steps. We’ll be happy to assist further if needed.

    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Susmitha T (INFOSYS LIMITED) 1,630 Reputation points Microsoft External Staff
    2025-07-02T05:33:29.79+00:00

    Could you please let us know if issue still persist? We’ll be happy to assist further if needed.


  4. Susmitha T (INFOSYS LIMITED) 1,630 Reputation points Microsoft External Staff
    2025-07-03T11:17:19.7133333+00:00

    Thank you for reaching out. Kindly check below alternate solution.

    Confirm that Control is public and inherits from UserControl: 

    public partial class MyControl : UserControl

    1. Check Target Framework
      • Right-click your project > Properties > Application tab.
        • Make sure you're targeting a framework like .NET 6.0 (Windows) or .NET Framework 4.x that supports WinForms/WPF and toolbox integration.
          • If you're using .NET 6.0, ensure it's the Windows-specific version (net6.0-windows), not just net6.0.
          1. Ensure Correct Output Type
            • Still in project properties, confirm the Output type is set to Windows Application, not Console or Class Library.
            1. Rebuild the Solution
              • Go to Build > Rebuild Solution to ensure all binaries are up to date.
              1. Manually Add Toolbox Items
                • Right-click inside the Toolbox > Choose Items...
                  • In the dialog, click Browse... and manually select your compiled .dll from the bin\Debug\net6.0-windows folder.
                    • This forces Visual Studio to load the controls even if automatic enumeration fails.
                    1. Restart Visual Studio
                      • Sometimes the toolbox cache needs a refresh. Close and reopen Visual Studio after rebuilding.
    2. Check for Visual Studio Updates
      • Go to Help > Check for Updates to ensure you're running the latest version, especially if you're using newer .NET versions.
      Let us know if the issue persists after following these steps. We’ll be happy to assist further if needed.
    0 comments No comments

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.