Skip to content

DragDropEffects display incorrectly #11847

@Liv-Goh

Description

@Liv-Goh

.NET version

.NET 9.0 SDK build: 9.0-rc 1.24407.28

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, this is a regression issue. Not reproduce on .NET 8.0

Issue description

The DrapDropEffects can be observe from the cursor icon. When drag the control from the label to the listBox it display incorrectly in .NET 9.0.

Current Behavior (.NET 9.0)
dragDropEffect29 0

Expected Behavior (.NET 8.0)
dragDropEffect28 0

Steps to reproduce

  1. Create a WinForms .NET Core project
  2. Add a label and listBox to the form
  3. Set the allowDrop property for both control to True
  4. Link the events for the controls as below
private void label1_MouseDown(object sender, MouseEventArgs e)
{
    label1.DoDragDrop(label1.Text, DragDropEffects.Copy | DragDropEffects.Move);
}

private void listBox1_DragEnter(object sender, DragEventArgs e)
{
    e.Effect = DragDropEffects.Copy;
}

private void listBox1_DragDrop(object sender, DragEventArgs e)
{
    listBox1.Items.Add(e.Data.GetData(DataFormats.Text).ToString());                
}
  1. Build and run the project
  2. Try to drag the label to the listBox and observe the change of cursor icon

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions