How can I see Vinta Elements in ToolBox? (VS2019)

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
pwsmietan
Posts: 7
Joined: Wed Aug 26, 2009 12:46 am

How can I see Vinta Elements in ToolBox? (VS2019)

Post by pwsmietan »

I have VS 2019 and tried to add items to the General node pointing at the DLL files (like the way we did it in VS2008/2010) but it didn't work. Is it different in VS 2019?
pwsmietan
Posts: 7
Joined: Wed Aug 26, 2009 12:46 am

How can I see Vinta Elements in ToolBox? (VS2019)

Post by pwsmietan »

Perhaps I should have mentioned my project is .Net Core 3.1 - does this behave differently than traditional .Net framework.
Alex
Site Admin
Posts: 2304
Joined: Thu Jul 10, 2008 2:21 pm

Re: How can I see Vinta Elements in ToolBox? (VS2019)

Post by Alex »

Hi Paul,

If you will try to add Vintasoft WinForms or WPF control to the Visual Studio designer in current version of Visual Studio 2019 (16.7.4 and 16.8.0 Preview 1.0), you will see the error "<path> targets a platform whose toolbox items cannot be enumerated dynamically.".

Error occurs because unfortunately designer of current version of Visual Studio 2019 (16.7.4 and 16.8.0 Preview 1.0) still does not support WinForms or WPF user controls for .NET Core 3.1 and .NET 5.0. This problem is reported to the Microsoft here: https://developercommunity.visualstudio ... infor.html

Unfortunately, Microsoft still does not able to provide good designer, which will support user controls for .NET Core. I hope good designer will be available soon.

As a temporary solution we suggest to create form/window design in designer for .NET Framework, i.e. you need to create .NET Framework project, create form, define form design in .NET Framework designer, copy created form/window from .NET Framework project to the .NET Core project.

Best regards, Alexander
Alex
Site Admin
Posts: 2304
Joined: Thu Jul 10, 2008 2:21 pm

Re: How can I see Vinta Elements in ToolBox? (VS2019)

Post by Alex »

The toolbox in Visual Studio 2022 still does not allow to use custom WinForms/WPF control for .NET 7/6/5 and .NET Core 3.1 if custom control is located in third-party .NET assembly.

For solving the problem you can create custom control (for example MyWpfImageViewer), which is derived from necessary control (for example WpfImageViewer), in your project. After this MyWpfImageViewer will be visible in Toolbox and you will be able to drop created WPF control to your WPF window.

Best regards, Alexander
Alex
Site Admin
Posts: 2304
Joined: Thu Jul 10, 2008 2:21 pm

Re: How can I see Vinta Elements in ToolBox? (VS2019)

Post by Alex »

If you want to create WinForms application for .NET 8 and place Vintasoft.Imaging.UI.ImageViewer control to the application form, you need to do the following steps:
  • Create/open WinForms application for .NET8 in Visual Studio 2022.
  • Add references to Vintasoft.Shared.dll, Vintasoft.Imaging.dll and Vintasoft.Imaging.UI.dll assemblies.
  • Create MyImageViewer class with the following code:

    Code: Select all

    namespace WinFormsApp1
    {
        public class MyImageViewer : Vintasoft.Imaging.UI.ImageViewer
        {
        }
    }
  • Rebuild the application - this is important step.
  • Open designer of WinForms form.
  • Open Toolbox and you will see MyImageViewer control in "WinFormsApp1" group - drop MyImageViewer control to your WinForms form.
Post Reply