1

I have created a custom control in C# with VS 2010 that is based (inherits) from the RectangleShape control that comes with VS 2010 but I can't see it in VS 2010 Tool Box. Why it is not there?

public partial class StepControl : Microsoft.VisualBasic.PowerPacks.RectangleShape
{
    public StepControl()
    {
        InitializeComponent();
    }

    protected override void OnPaint(PaintEventArgs pe)
    {
        base.OnPaint(pe);
    }
}
R.J. Dunnill
  • 2,049
  • 3
  • 10
  • 21
Eyal
  • 83
  • 4
  • Have you added the assembly containing the control to the toolbox? See this similar question: http://stackoverflow.com/questions/3446431/adding-custom-controls-dll-to-visual-studio-toolbox – Oscar Dec 26 '13 at 08:37
  • This control is part of my project, not a separate DLL control. I checked Options -> Windows Forms Designer -> AutoToolboxPopulate but it is True so this is not the problem – Eyal Dec 26 '13 at 09:03

1 Answers1

1

I'm assuming you're using VS2010 (that's what you've tagged the question as) I had problems getting them to add automatically to the toolbox as in VS2008/2005. There's actually an option to stop the toolbox auto populating!

Go to Tools > Options > Windows Forms Designer > General

At the bottom of the list you'll find Toolbox > AutoToolboxPopulate which on a fresh install defaults to False. Set it true and then rebuild your solution.

Hey presto they user controls in you solution should be automatically added to the toolbox. You might have to reload the solution as well.

Yanshof
  • 9,659
  • 21
  • 95
  • 195