winforms icon indicating copy to clipboard operation
winforms copied to clipboard

ControlDesigner GetHitTest is not supported under net6.0

Open Eviav opened this issue 1 year ago • 5 comments

Environment

17.11.3

.NET version

net6.0 - net8.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

framework all is normal

Issue description

my custom controls cannot capture mouse clicks, but System.Windows.Forms.TabControl can

Steps to reproduce

Here is a demo, the framework 4.8 can capture the mouse in the designer, but I hope the designer can also capture the mouse normally under net6.0

TestDesignGetHitTest.zip

Diagnostics

No response

Eviav avatar Sep 11 '24 01:09 Eviav

@EVA-SS In contrast to .NET Framework projects, WinForms designer for .NET projects uses a completely different architecture. It spawns an external process to load .NET assemblies and resolve types. There is a distinction in the way it loads design time and runtime assemblies. For WinForms .NET designer, you will need to reference WinForms designer SDK package available on nuget.org. For documentation and samples check: https://github.com/microsoft/winforms-designer-extensibility

cc: @KlausLoeffelmann, @JeremyKuhne

Shyam-Gupta avatar Sep 27 '24 01:09 Shyam-Gupta

@EVA-SS In contrast to .NET Framework projects, WinForms designer for .NET projects uses a completely different architecture. It spawns an external process to load .NET assemblies and resolve types. There is a distinction in the way it loads design time and runtime assemblies. For WinForms .NET designer, you will need to reference WinForms designer SDK package available on nuget.org. For documentation and samples check: https://github.com/microsoft/winforms-designer-extensibility

cc: @KlausLoeffelmann, @JeremyKuhne

Thank you, but GetHitTest still doesn't work 😂

Eviav avatar Sep 27 '24 05:09 Eviav

Could you please share your updated project?

Shyam-Gupta avatar Sep 27 '24 14:09 Shyam-Gupta

Here, after trying to reference the WinForms designer SDK, only System.ComponentModel.Design.DesignerActionList can be recognized normally on the Core project. Many UITypeEditor still do not support it, including override bool GetPaintValueSupported and override void PaintValue

TestDesignGetHitTest.zip


image

How should I use the SDK correctly, or is this interaction method not allowed by the official 🤔

Eviav avatar Sep 29 '24 02:09 Eviav

@KlausLoeffelmann Would you have some suggestions here?

Shyam-Gupta avatar Sep 30 '24 20:09 Shyam-Gupta