Screen.PrimaryScreen プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Screen.PrimaryScreen プロパティの意味・解説 

Screen.PrimaryScreen プロパティ

プライマリ ディスプレイ取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Shared ReadOnly Property
 PrimaryScreen As Screen
Dim value As Screen

value = Screen.PrimaryScreen
public static Screen PrimaryScreen { get;
 }
public:
static property Screen^ PrimaryScreen {
    Screen^ get ();
}
/** @property */
public static Screen get_PrimaryScreen ()

プロパティ
プライマリ ディスプレイ

解説解説
使用例使用例

PrimaryScreen プロパティと GetWorkingArea メソッド使用方法次のコード例示します。このメソッドには、Button1 という名前のボタン配置されているフォームが必要です。

' This method will adjust the size of the form to utilize 
' the working area of the screen.

Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click

    ' Retrieve the working rectangle from the Screen class
    ' using the PrimaryScreen and the WorkingArea properties. 
    Dim workingRectangle As System.Drawing.Rectangle
 = _
        Screen.PrimaryScreen.WorkingArea

    ' Set the size of the form slightly less than size of 
    ' working rectangle.
    Me.Size = New System.Drawing.Size(workingRectangle.Width
 - 10, _
        workingRectangle.Height - 10)

    ' Set the location so the entire form is visible.
    Me.Location = New System.Drawing.Point(5,
 5)

End Sub
// This method will adjust the size of the form to utilize 
// the working area of the screen.
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    // Retrieve the working rectangle from the Screen class
    // using the PrimaryScreen and the WorkingArea properties.
    System.Drawing.Rectangle workingRectangle = 
        Screen.PrimaryScreen.WorkingArea;
    
    // Set the size of the form slightly less than size of 
    // working rectangle.
    this.Size = new System.Drawing.Size(
        workingRectangle.Width-10, workingRectangle.Height-10);

    // Set the location so the entire form is visible.
    this.Location = new System.Drawing.Point(5,
 5);
}
   // This method will adjust the size of the form to utilize 
   // the working area of the screen.
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Retrieve the working rectangle from the Screen class
      // using the PrimaryScreen and the WorkingArea properties.
      System::Drawing::Rectangle workingRectangle = Screen::PrimaryScreen->WorkingArea;
      
      // Set the size of the form slightly less than size of 
      // working rectangle.
      this->Size = System::Drawing::Size( workingRectangle.Width
 - 10, workingRectangle.Height - 10 );
      
      // Set the location so the entire form is visible.
      this->Location = System::Drawing::Point( 5, 5 );
   }
// This method will adjust the size of the form to utilize 
// the working area of the screen.
private void button1_Click(Object sender, System.EventArgs
 e)
{
    // Retrieve the working rectangle from the Screen class
    // using the PrimaryScreen and the WorkingArea properties.
    System.Drawing.Rectangle workingRectangle =
        Screen.get_PrimaryScreen().get_WorkingArea();
    // Set the size of the form slightly less than size of 
    // working rectangle.
    this.set_Size(new System.Drawing.Size(workingRectangle.get_Width()
        - 10, workingRectangle.get_Height() - 10));
    // Set the location so the entire form is visible.
    this.set_Location(new System.Drawing.Point(5,
 5));
} //Button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からScreen.PrimaryScreen プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からScreen.PrimaryScreen プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からScreen.PrimaryScreen プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Screen.PrimaryScreen プロパティ」の関連用語

Screen.PrimaryScreen プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Screen.PrimaryScreen プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS