简体   繁体   English

如何将“绘图”组件添加到WinForms控件中?

[英]How do I add “drawing” components to a WinForms control?

I'm using .NET 2.0 Windows Forms and want to add "drawing" components such as lines, rectangles, etc.. I've done this before in MS Access, but I can't seem to find similar things in teh Visual Studio 2005 IDE. 我正在使用.NET 2.0 Windows窗体,并希望添加“绘图”组件,例如线条,矩形等。我之前在MS Access中已经做到这一点,但在Visual Studio中似乎找不到类似的东西2005 IDE。 Where do I need to look to find these elements? 我需要在哪里寻找这些元素?

If you're using .NET 2 with Windows Forms, one option is to install the Visual Basic 2005 Power Pack (which is also usable from C#). 如果将.NET 2与Windows窗体一起使用,则一种选择是安装Visual Basic 2005 Power Pack (也可从C#中使用)。 It includes a series of line and shape controls . 它包括一系列线条和形状控件

Otherwise, you can use GDI+ and the System.Drawing namespace to draw manually. 否则,您可以使用GDI +和System.Drawing命名空间手动绘制。

Since these components are not in Visual Studio (the way they were for VB6), you have four choices. 由于这些组件不在Visual Studio中(它们对于VB6的使用方式),因此您有四个选择。

Personally, I like options 3 and 4. 就个人而言,我喜欢选项3和4。

Added 添加

Hey, here's a good article for option 4! 嘿,这是选项4的好文章! http://msdn.microsoft.com/en-us/library/aa289517(VS.71).aspx http://msdn.microsoft.com/en-us/library/aa289517(VS.71).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM