How do I make an custom drawn resizable container?

我只是一个虾纸丫 提交于 2019-12-13 06:34:30

问题


I have a WinForms gui application which has a number of areas to it which I'd like to custom-draw some graphics. These areas would contain controls and be resizeable. I'm currently thinking of inheriting from a TableLayoutPanel and handling onpaint messages.

Does this sound like a good way to go or are there other/better options?


回答1:


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.



来源:https://stackoverflow.com/questions/3265202/how-do-i-make-an-custom-drawn-resizable-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!