フォームを画面全体表示(マルチディスプレイ対応) | 備忘録 (。・_・。)ノ

読まないといけない本3冊(統計分析)からの現実逃避で来年の仕事を少々…

趣味の範囲だったのでQiitaにロジック投稿。

Qiitaからメール:[Qiita] 編集リクエストを受け取りました。

※ロジックアドバイスを受け取りました。

    Dim s As System.Windows.Forms.Screen
    Dim intHeight As Integer = 0
    Dim intWidth As Integer = 0

    ''ディスプレイ情報取得
    For Each s In System.Windows.Forms.Screen.AllScreens
        intWidth = intWidth + s.Bounds.Width
        If intHeight < s.Bounds.Height Then
            intHeight = s.Bounds.Height
        End If
    Next

    ''画面プロパティ再設定
    Console.WriteLine("高さ:{0} 幅:{1}", intHeight, intWidth)
    ''横位置、縦位置、横幅、高さ
    Me.Bounds = New Rectangle(0, 0, intWidth, intHeight)