dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

When using "Choose Icon... " command line to add an icon, the icon is displayed in an incorrect position #10830

Closed MandiMan closed 9 months ago

MandiMan commented 9 months ago

.NET version

9.0.100-preview.2.24103.2

Did it work in .NET Framework?

Yes

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

Yes, cannot repro in 9.0.0-alpha.1.24053.2, but repro in 9.0.100-alpha.1.24066.22

Issue description

When using "Choose Icon... " command line to add an icon, the icon is displayed in an incorrect position Actual Results The icon is displayed in the upper left corner of the properties window

image

Expected Results The icon should be displayed in the correct position image

Steps to reproduce

  1. Create a Winforms .Net Core application
  2. Add a notifyIcon and propertyGrid to form designer
  3. Click on propertyGrid1 and change its SelectedObject property to notifyIcon1
  4. Build & Run
  5. Adding the icon for Icon property by using "Choose Icon..." command line
  6. Observed the position of the added icon for Icon property

https://github.com/dotnet/winforms/assets/108860782/81904b97-982c-4aef-879f-786cbd2dc279

elachlan commented 9 months ago

Related: #10579

LeafShi1 commented 9 months ago

This issue is caused by PR #10641

Philip-Wang01 commented 9 months ago

Verified this issue on .NET 9.0.0-preview.2.24107.18 with dlls built from winforms repo of main branch, the issue has been fixed that the icon displayed in the correct position.

https://github.com/dotnet/winforms/assets/86937911/a10d825c-13e4-48ea-9fd6-3c07b1bf0618

MelonWang1 commented 8 months ago

Verified this issue with .NET 9 Preview 2 test pass build, it was fixed. Test result is same as above.