Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why can't I open a class inherited from a panel in the designer, just as I can open a class inherited from a Form or Usercontrol classes.
What needs to be done for this?
C#
class MyPanel : Panel
{

}


What I have tried:

I don't even know what to do.

Пробовал копировать код пользовательского контрола, но не получилось.
I tried to copy the code of the user control, but it did not work
Posted
Updated 28-Sep-22 3:24am
v2
Comments
Richard Deeming 28-Sep-22 4:08am    
This is an English-language site. Your entire question should be posted in English. I have added a Google translation of your final sentence.

1 solution

It must have an associated custom designer file, see:
Create a Control That Takes Advantage of Visual Studio Design-Time Features - Windows Forms .NET Framework | Microsoft Learn[^]

If you want to inherit from Panel, take a look at this CodeProject article:
C# Custom Control Featuring a Collapsible Panel[^]
 
Share this answer
 
v2
Comments
Maciej Los 28-Sep-22 17:41pm    
5ed!
Member 15737294 29-Sep-22 4:57am    
it's not exactly what I wanted. The control is inherited from the Usercontrol. I would like to avoid this.
Ralf Meier 29-Sep-22 6:10am    
You should give much more Information - either about your control and also about the code you are using ...
Without this it is impossible to give useful advises - sorry

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900