且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何制作自定义绘制可调整大小的容器?

更新时间:2023-02-05 22:11:23

任何Windows Forms控件都有一个Paint事件,你不必派生自己的类。但是,肯定,你可以,它帮助分区的代码。只需选择一个已经提供大部分需要的基类。在构造函数中将DoubleBuffered属性设置为true,并重写OnPaint。

Any Windows Forms control has a Paint event, you don't have to derive your own class. But sure, you can, it helps partitioning the code. Just pick a base class that already provides most of what you need. Set the DoubleBuffered property to true in the constructor and override OnPaint.