Adding a custom user control and using it with VB Form Designer

Anthony White 21 Reputation points
2022-10-19T17:50:33.973+00:00

Following verbatim the Visual Studio tutorial

https://learn.microsoft.com/en-us/visualstudio/designers/walkthrough-windows-forms-designer

I created the test DemoCalculator Custom Control Project class library. I then create the DemoCalculatorTest forms application.

1) When I Add>Reference, the Reference the Custom Control project does not show up. I manually browse and add the dll, but am unable to add it to the toolbox to use it in designer mode. I've tried difference things, like manually adding click on the control in the Reference dialog, manually adding the control to the toolbox using Choose Items, but nothing works.

Is it possible to create a custom control and use it in designer mode at all?

I am using Visual Studio 2022 V 17.3.6, .NET Framework Version 4.8.04084

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,884 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,713 questions
{count} votes

3 answers

Sort by: Most helpful
  1. LesHay 7,126 Reputation points
    2022-10-19T18:29:20.763+00:00

    Hi

    The custom control should show in the ToolBox after it has successfully compiled.
    Try rebuilding, making sure there are no errors etc - you should not need a reference. Then check the ToolBox (mine always show up at the top)

    0 comments No comments

  2. Anthony White 21 Reputation points
    2022-10-20T15:26:12.887+00:00

    I created a Windows Forms Control Library, but the target framework is 4.7.2.

    The Windows Forms App is 6.0

    I am not sure how to upgrade the Forms Control Library to 6.0

    0 comments No comments

  3. Anthony White 21 Reputation points
    2022-10-20T15:58:08.183+00:00

    It looks like I've successfully updated the Forms Control Library to .Net 6.0.

    Thanks!

    0 comments No comments

Your answer

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