boilers222
boilers222

Reputation: 1989

How do I view and edit Visual Basic Power Pack shapes in a Windows Form app with Visual Studio 2017?

I've got a windows forms app created in an older version of Visual Studio. When I open it in VS 2017, none of the Power Pack shapes are show in the design view. I've got the Power Pack dll in references. I tried to add them to the toolbox (General, Choose Items, .Net Framework Components), but the shapes like Rectangle Shape are missing. How can I either get them to display in the design view or add new ones through the toolbox?

Here is the reference to Power Pack: enter image description here

Here's the choose toolbox item where you can see RectangleShape is missing: enter image description here

Here's the code where the rectangle is defined:

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});

Upvotes: 1

Views: 5353

Answers (1)

Reza Aghaei
Reza Aghaei

Reputation: 125227

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

Upvotes: 2

Related Questions