Create custom winforms container

后端 未结 2 838
甜味超标
甜味超标 2021-02-05 10:25

I want to create a control in winforms with same behavior as the container controls. I mean: in design mode, when I drop controls in it, it will group then, just like a groupbox

2条回答
  •  难免孤独
    2021-02-05 10:39

    Maybe this is what you need, I found it at CodeProject a time ago:

    Designing Nested Controls:

    This article demonstrates how to allow a Control, which is a child of another Control to accept having controls dropped onto it at design time. It is not a large article, there is not much by way of code, and this may not be either the 'official' or best way to do this. It does, however, work, and is stable as far as I have been able to test it.

提交回复
热议问题