1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

.NET Core 3.1 の Windows Forms で PerMonitorV2 動かしてみた

Posted at

先日やった .NET Framework 4.7.2 + Windows Forms の PerMonitorV2 での動作確認 ですが LTS 版の .NET Core 3.1 でも試してみました。

ちなみに元記事に追記していますが、ListBox の変な動きは .NET Framework 4.8 にしたらなおってました。めでたしめでたし。

やってみよう

.NET Core 3.1 では、.NET Framework と違って Main メソッドで Application.Run(new Form1()); より前に Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); を呼ぶことで PerMonitorV2 になるらしいです。

WinForms の高 DPI

ということでフォームの AutoScaleMode を DPI にして ListBox と DataGridView を置いて試してみました。

100%
image.png

150%
image.png

100%
image.png

ListBox の愉快な症状はおきなかったですが、DataGridView の CheckBox は 150% に持って行っても小さいままでした。
ここら辺は自前でどうにか頑張る(頑張り方は自分は知らない…)しかないのかなぁ?

ここまでのまとめ

.NET Framework 4.8 と .NET Core 3.1 では ListBox と DataGridView を見る限りは動きはそんなに変わってないように見えるので、あとは、DataGridView のようにそのまま使っただけではちゃんと動かないコントロールの対応方法などを確認しないといけないかも。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?