Skip to content

Incorrect Mouse Event Capturing During Design Time in .NET Core Projects Prevents Drag-and-Drop of Custom Docked Panel #13177

Closed
@NagarajManimaran

Description

@NagarajManimaran

Environment

Visual Studio professional 2022 - version 17.13.0

.NET version

.NET 8

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

No

Issue description

We are attempting to click and drag the docked panel in a CustomDockingManager control during design time in .NET Core projects, but it is not working. However, this functionality works correctly in .NET Framework projects.

To debug this, I compared the designer behavior in both environments. In .NET Framework, when I move the mouse in Form.Design and click the docked panel, the GetMsgProc method correctly captures mouse events such as:

m.msg = 0x0200 (WM_MOUSEMOVE)

m.msg = 0x0201 (WM_LBUTTONDOWN)

However, in .NET Core, when I move the mouse in the form, GetMsgProc captures unrelated messages such as:

m.msg = 15 (WM_PAINT)

m.msg = 49765

These values are not related to mouse events, causing the mouse actions to be ignored. As a result, I am unable to click and drag the panel in .NET Core.

Is there a way to capture the correct mouse-related messages during design time in .NET Core?

If not, is there an alternative approach to capture mouse event handling in design mode for .NET Core?

I have attached a sample project (CustomControl.zip) demonstrating the issue.
Kindly provide suggestions to resolve this problem.

customcontrolCore.zip

Steps to reproduce

Open the sample project (CustomControl.zip).

Drag and drop the CustomDockingManager component onto the form.

Drag and drop the Customdockpanel control onto the CustomDockingManager.

Right click the Customdockpanel to set true value to the enabledocking property.

Try to click and drag the docked panel to a new location.

Diagnostics


Metadata

Metadata

Labels

area-VSDesignerWindows Forms out-of-proc designer related issueswaiting-author-feedbackThe team requires more information from the author

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions