Quinxy von Besiex
Quinxy von Besiex

Reputation: 976

Change WinForm to Win Control, Works Fine but Invisible in Visual Studio Designer

I've converted a Windows Form into a Windows Control (by changing the code's parent from Form to Control, removing a few minor/irrelevant Form property assignments, and changing the project settings to "Class Library" instead of Windows Form Application). The Control works great in my application, but when I open it up in Visual Studio Designer there is nothing there except the labels for the items it isn't showing me (panel1, button1, etc.).

How do I get designer working again? It gives no errors.

Upvotes: 2

Views: 145

Answers (1)

Hans Passant
Hans Passant

Reputation: 942348

You'll get the wrong designer when you do this. The default designer for the Control class is not a DocumentDesigner, the kind of designer that supports editing nested controls. The simplest fix is to change the base class of your class from Control to UserControl.

Upvotes: 3

Related Questions