none
Powershell GUI Form Full Screen RRS feed

  • Question

  • Trying to create a simple form with the screen full size, but so far could not get the desired result. Can someone please help

    Add-Type -AssemblyName System.Windows.Forms

    [System.Windows.Forms.Application]::EnableVisualStyles()

    $Form                            = New-Object system.Windows.Forms.Form
    $Form.ClientSize                 = '814,593'
    $Form.text                       = ""
    $Form.BackColor                  = "#ffffff"
    $Form.TopMost                    = $false
    $form.ControlBox = $false

    Would like the form to be displayed in full screen when launched.

    Tuesday, January 15, 2019 10:11 PM

Answers

  • Even neater:

    $Form = New-Object system.Windows.Forms.Form
    $form.WindowState = 'Maximized'
    $form.FormBorderStyle = 'None'
    $form.ShowDialog()

     


    \_(ツ)_/

    Tuesday, January 15, 2019 10:20 PM

All replies

  • $Form = New-Object system.Windows.Forms.Form
    $form.WindowState = 'Maximized'
    $form.ShowDialog()


    \_(ツ)_/


    • Edited by jrv Tuesday, January 15, 2019 10:18 PM
    Tuesday, January 15, 2019 10:18 PM
  • Even neater:

    $Form = New-Object system.Windows.Forms.Form
    $form.WindowState = 'Maximized'
    $form.FormBorderStyle = 'None'
    $form.ShowDialog()

     


    \_(ツ)_/

    Tuesday, January 15, 2019 10:20 PM