更新时间: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.