dotnet / dotnet/winforms

WinForms layout issue with CheckBox and ComboBox when using HighDpiMode.PerMonitorV2

Open
#14,376 13 comments 0 reactions 1 assignee Claimed by @LeafShi1 View on GitHub
area-HDPI untriaged
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### .NET version

.NET 10

### Did it work in .NET Framework?

Not tested/verified

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

_No response_

### Issue description

When a UserControl contains a CheckBox and a ComboBox, enabling
`Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);`
causes a height mismatch between the controls. The ComboBox appears slightly taller, which results in two visible lines at the bottom of the control.

This only occurs when PerMonitorV2 DPI awareness is enabled.

### Steps to reproduce
(A video and a VS project are attached below as demo)
Create a UserControl containing: one CheckBox and one ComboBox

Example startup code:
```
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);

Application.Run(new Form1());
}
```
Place both controls on a UserControl, aligned vertically.

https://github.com/user-attachments/assets/4e98643b-8c81-462f-844a-80f9233079b1
[CAD_VS2026.zip](https://github.com/user-attachments/files/25876676/CAD_VS2026.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.