我应该使用PictureBox还是Panel来绘制我的表格?

时间:2022-07-06 20:20:01

Is there a recommended one to use in order to add lines and circles, so I can build a graph? I will possibly work with background images under the graph itself.

是否有一个推荐的用于添加线条和圆圈,所以我可以建立一个图表?我可能会在图表本身下使用背景图像。

1 个解决方案

#1


6  

Use a PictureBox - it'll be easiest to maintain the code later on. A Panel is not really useful in this case and drawing directly on the Form - while it'd work - would make it harder to make changes later on.

使用PictureBox - 以后维护代码最容易。在这种情况下,小组并不是真正有用,直接在表格上绘制 - 虽然它有效 - 会使以后更难进行更改。

Just handle the Paint event of the PictureBox and do all your drawing in there.

只需处理PictureBox的Paint事件,然后在那里完成所有绘图。

#1


6  

Use a PictureBox - it'll be easiest to maintain the code later on. A Panel is not really useful in this case and drawing directly on the Form - while it'd work - would make it harder to make changes later on.

使用PictureBox - 以后维护代码最容易。在这种情况下,小组并不是真正有用,直接在表格上绘制 - 虽然它有效 - 会使以后更难进行更改。

Just handle the Paint event of the PictureBox and do all your drawing in there.

只需处理PictureBox的Paint事件,然后在那里完成所有绘图。