With VS 2022, the Toolbox does not show the toolboxbitmap of controls installed by a package

Loïc GAUDOUEN 0 Reputation points

When a package including controls is installed in a project, a tab is added to the Toolbox. Each tab includes a pointer followed by installed controls.

The control's perfectly existing ToolboxBitmap is replaced by the icon of a UserControl without a ToolboxBitmap.

Is this really normal?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,700 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Loïc GAUDOUEN 0 Reputation points

    For your information on what I wrote:

    1 - The packages are installed like everyone else by the VS nuget manager.

    2 - I am not talking about a particular control but about all the controls derived from Control, UserControl or Component included in all the packages that I have used, professional or not or even those that I have been able to create for years (I I started developing ActiveX when it existed...).

    3 - Like everyone else, the control declarations are prefixed by the attributes

     [ToolboxBitmap(typeof(xxxx), "xxxx.bmp")]

    5 - if you drag the control in the toolbox from the tab corresponding to the nuget to a standard tab, the bitmap does not appear (which is normal since it is only a move in the listbox).

    6 - The dlls in the package tabs do not appear in the Toolbox element selection dialog box.

    This is important to understand that the problem does not come from the control(s) but from the process of adding them during the installation of the nuget which is visibly incomplete since, not only does it not extract the bitmap (the one we see in the listbox (visible part) is the one corresponding to a control without bitmap) but in addition does not add the dll in the part of the toolbox managing the components ("invisible" part, managed via the choice dialog box elements).

    To convince yourself that there is a small problem in the management of the Toolbox (both parts): if you manually add a control in the toolbox, it remains there both in the listbox and in the management box even if the assembly has been deleted (but, all the same, we cannot insert it in the form designer!). To delete it, you must do it manually either "delete" in the listbox, or uncheck it in the item management box.

    This little one is added to that of the installation/uninstallation of a nuget which should correctly install the controls in the Toolbox but also delete them during uninstallation rather than leaving them like the others added manually.

    But I think everyone knows that.

    0 comments No comments

  2. Loïc GAUDOUEN 0 Reputation points

    A missing point removed by the editor :

    4 - if you add the dll by hand via the dialog box for choosing toolbox elements, you can clearly see the control bitmap.