dotnet / dotnet/winforms

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

Open
#7,363 2 comments 0 reactions 0 assignees View on GitHub
area-HDPI-PMv2
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### .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/176385452-dcd72b4a-c2cf-4b93-b88a-f562f54f8386.png)
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
`PerMonitorV2`
6. Build and run application
7. 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…]()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.