How to create a banner panel in C #?

I want to create my own custom control, which is basically a TableLayoutPanel with 3 rows and 1 column. The top and bottom lines will contain labels (banners), and the middle line will be where I will add other controls. The problem is that when I try to create other elements / controls from this control, the designer does not recognize the middle panel. How do i get this? If I drag the text box in the middle and set Dock = Fill, it will close the entrie form / control. Also, is there a way to get the designer to reject dragging and dropping controls to the top and bottom (banner) lines? I tried the steps in the following link, but I had no luck ( http://support.microsoft.com/?scid=kb%3Ben-us%3B813450&x=21&y=15 ).

+3
source share
1 answer

I understood that. The trick was to create my own constructor, which inherits from ParentControlDesigner and overrides the Initialize method and calls EnableDesignMode on the inner content panel. In addition, I needed to set the Designer attribute of my user control for this new designer. Details are shown here .

. , , . , , . , , . .

+3

Source: https://habr.com/ru/post/1718286/


All Articles