Visual Basic Powerpacks for VS2022 (basic shapes to toolbox)

tapf 11 Reputation points
2022-03-30T13:50:20.29+00:00

Hi all,
I would like to use basic shapes provided by Visual Basic Powerpacks in Winforms. I've used vbpowerpacks 12.0 in VS2019 earlier, but since buying new pc and upgrading to VS2022 it doesn't work anymore.

Is there some other vbpowerpacks.exe that would provide basic shapes to winforms toolbox in VS2022 or is there any workaround for this issue?

Would be very thankfull if someone can help with this! :)

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,521 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 50,426 Reputation points
    2022-03-30T14:03:04.3+00:00

    That library is an older library and some of the controls didn't work even on previous VS versions. You can read the writeup about it here. MS has no intention of supporting or upgrading these controls anymore.

    If you installed the library then add a reference to it in your project. Then go to the Toolbox, right click and select Choose Items. Then find the assembly and select it. This should add any compatible controls to the toolbox. Unfortunately it might not show up so you might need to use the Browse button. If the controls are remotely compatible with the newer designer then they should show up in the toolbox.

    Having said that, at the end of the day literally the only benefit of the toolbox is to drag and drop controls onto a form. From that point on it is entirely handled in code. As the Winforms Designer has been rewritten to work with .NET Core the general recommendation is to simply add the code yourself to get the control onto the form. After that you should be able to see and interact with the controls as you did before. If they had custom designers then those will no longer work but the Properties window and whatnot should be fine.

    To manually add the control(s) you can replicate what the designer does.

    1) Open the *.designer.cs file.
    2) Add a private field with the fully qualified type name and the name of the field.
    3) Inside InitializeComponent

    1. Instantiate an instance of the type and assign to the field
    2. Set the control's Name and other related properties.
    3. Add the control to the parent form's Controls property.

    Alternatively you can just do all this in the constructor of the form as well but I've seen issues with the designer when you do that. Alternatively programmatically do the same thing when the form's OnLoad method is called.


  2. David Goben 40 Reputation points
    2023-04-11T00:04:48.1866667+00:00

    The last version of the free Visual Basic Power Packs 3.0 that worked reliably, even on VB2022, was version 9.0.30214.0 (versions 10 and 12 do not work on VB2022). The 9.0 version can still be found online, except at Microsoft Downloads. There are free software archiving sites still out there that still carry it. Just search for "Visual Basic Power Packs" and explore non-MS sites. The only drawback is we must build for Win32 platforms under .NET 3-4 Framework.

    0 comments No comments