6
9

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 5 years have passed since last update.

Visual StudioでWindowsフォーム画面デザイン時の注意点

Last updated at Posted at 2020-01-27

■概要

Visual Studioで「メインディスプレイのスケールは xxx% に設定されています。」という黄色いバーが出たら急いで保存せずに閉じてOSのDPIを100%にしましょう。
vs2019_hdpi.png

キーワード:高DPI, Hi-DPI

■設定方法

Windows 7の場合

  1. デスクトップを右クリックし、[画面の解像度]を選択する
  2. [テキストやその他の項目の大きさの変更]リンクを選択する
  3. 100%を選択し、[適用]ボタンを押す
  4. ログオフを求められたらログオフする

Windows 8.1の場合

  1. デスクトップを右クリックし、[画面の解像度]を選択する
  2. [テキストやその他の項目の大きさの変更]リンクを選択する
  3. [すべてのディスプレイで同じ拡大率を使用する]をチェック状態にする
  4. 100%を選択し、[適用]ボタンを押す
  5. サインアウトを求められたらサインアウトする

Windows 10の場合

  1. デスクトップを右クリックし、[ディスプレイ設定]を選択する
  2. [テキスト、アプリ、その他の項目のサイズを変更する]で100%を選択
  3. サインアウトを求められたらサインアウトする

■補足

これは高DPI環境でWindowsフォームデザイナーを開いたときに表示される「レイアウトが崩れるよ」警告です。注意を促してくれるのはVisual Studio 2017~ですが、それより前のVisual Studioでも問題は発生します。

対策方法はいくつかありますが、この方法が一番安全だと思います。
または高DPI環境で開発するときはWindowsフォームデザイナーを開かずに頑張るのも手です。

6
9
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
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?