更新时间:2023-02-02 17:41:43
您链接的文章似乎是C ++,这也许可以解释为什么它对您没有太大帮助.
如果为MouseDown和MouseUp创建事件,则应具有矩形所需的两个角点.从那里开始,只需绘制表格即可.System.Drawing.*应该是您的第一站.以下链接了一些教程:
I want to draw a rectangle on a form in C#. I read and found this article. Are there any samples or tutorials available ? The article was not very helpful.
The article you linked appears to be C++, which may explain why it didn't help you much.
If you create events for MouseDown and MouseUp, you should have the two corner points you need for a rectangle. From there, it's a matter of drawing on the form. System.Drawing.* should probably be your first stop. There are a couple of tutorials linked below:
Drawing with Graphics in WinForms using C#