dotnet / dotnet/winforms

Setting MinimumSize activates the Form

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

Description

### .NET version

.NET 8-windows

### Did it work in .NET Framework?

Not tested/verified

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

not that I know of

### Issue description

I'm seeing that setting `MinimumSize` on a Form, activates it.

This was reported here: https://github.com/dotnet/winforms/issues/7251 though not sure what the resolution was

And here https://github.com/dotnet/winforms/issues/3020 where it's suggested that they don't want to fix this.

I haven't found a good workaround for this. I can detect if the Form isn't active and pend the MinimumSize set for when it becomes active, but this causes others problems for me, so I would like this fixed.

### Steps to reproduce

.net 8 WinForms app on Windows 11, per-monitor v2 DPI (though this reprod when the app wasn't DPI aware)

can paste some sample app if I have time, but just create a barebones app that sets MinimumSize on a timer a couple times and focus on another Form. Focus should move to the first Form.

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.