1

我在旧版本的 Visual Studio 中创建了一个 Windows 窗体应用程序。当我在 VS 2017 中打开它时,设计视图中没有显示任何 Power Pack 形状。我在参考资料中有 Power Pack dll。我尝试将它们添加到工具箱(常规、选择项目、.Net 框架组件),但缺少矩形形状等形状。如何让它们显示在设计视图中或通过工具箱添加新的?

以下是对 Power Pack 的参考: 在此处输入图像描述

这是您可以看到缺少 RectangleShape 的选择工具箱项: 在此处输入图像描述

这是定义矩形的代码:

private Microsoft.VisualBasic.PowerPacks.RectangleShape StandardFiltersToUseRectangleShape;

this.StandardFiltersToUseRectangleShape = new Microsoft.VisualBasic.PowerPacks.RectangleShape();
this.StandardFiltersToUseRectangleShape.BorderWidth = 3;
this.StandardFiltersToUseRectangleShape.Location = new System.Drawing.Point(626, 82);
this.StandardFiltersToUseRectangleShape.Name = "StandardFiltersToUseRectangleShape";
this.StandardFiltersToUseRectangleShape.Size = new System.Drawing.Size(600, 15);

this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] {
this.StandardFiltersToUseRectangleShape,
this.FiltersToBuildRectangleShape});
4

1 回答 1

2

You are looking into a wrong assembly. You need to look into Microsoft.VisualBasic.PowerPacks assembly.

Visual Basic Power Packs Controls are not included in Visual Studio by default. First you should download and install them. Then to add them to the toolbox:

Right click on ToolBoxChoose Items ...Filter for powerpacks → Check controls → click OK.

enter image description here

于 2018-06-15T19:07:36.597 回答