dotnet / winforms

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

[Multi-Monitor] Unhandled exception pops up when expanding DataGridView ComboBox dropdown list on secondary monitor #7363

Open Olina-Zhang opened 2 years ago

Olina-Zhang commented 2 years ago

.NET version

7.0.100-preview.7.22323.18

Did it work in .NET Framework?

No

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

No

Issue description

Unhandled exception pops up when expanding DataGridView ComboBox dropdown list to choose item on secondary monitor image https://user-images.githubusercontent.com/26474449/176389641-8c4dda22-f26b-459f-9cb8-df37f209fcc1.mp4

Steps to reproduce

Repro steps:

  1. Set 2 monitors environment with different DPI values: Primary monitor is 300% DPI, secondary monitor is 100% DPI
  2. Create a Winforms application with targeted .Net 7.0
  3. Add a DataGridView to form designer and add a ComboBox column with some items
  4. In this app's csproj file, add following value <ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
  5. Build and run application
  6. In primary screen, click DataGridView comboBox dropdown list to choose item, then move form to secondary screen, click DataGridView comboBox dropdown list to choose item again

or use following app to test: [Uploading DGV_ComboBox.zip…]()

dreddy-work commented 2 years ago

And ComboBox is set to AutoComplete mode. This happen only when that property on Combobox is set.

merriemcgaw commented 2 years ago

Let's take a look at this when we get to doing the DGV in PerMonitorV2. I think taking a holistic approach to the DGV.