Skip to content

Instantly share code, notes, and snippets.

@atao
Created November 14, 2016 16:28
Show Gist options
  • Save atao/a3d9516a792849e11dc0fe4aeff1384c to your computer and use it in GitHub Desktop.
Save atao/a3d9516a792849e11dc0fe4aeff1384c to your computer and use it in GitHub Desktop.
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void] [System.Windows.Forms.Application]::EnableVisualStyles()
$Form = New-Object system.Windows.Forms.Form
$Form.Size = New-Object System.Drawing.Size(250,300)
$Form.Text = "Tools"
$Icon = New-Object system.drawing.icon ("C:\Program Files (x86)\ASUS\ASUS Smart Gesture\DesktopManager\resource\WindowStoreApp.ico")
$Form.Icon = $Icon
$Form.AutoSize = $True
$Form.AutoSizeMode = "Growonly"
$Form.AutoScroll = $True
$Form.TopMost = $true
$Form.MinimizeBox = $False
$Form.MaximizeBox = $False
$Form.WindowState = "Normal"
$Form.SizeGripStyle = "Hide"
$Form.ShowInTaskbar = $True
$Form.Opacity = 1.0
$Form.StartPosition = "WindowsDefaultLocation"
$button_quit = New-Object System.Windows.Forms.Button
$button_quit.Text = "Fermer"
$button_quit.AutoSize = $True
$button_quit.Size = New-Object System.Drawing.Size(245,30)
$button_quit.Location = New-Object System.Drawing.Size(5,220)
$button_quit.Add_Click({$form.Close();})
$Form.Controls.Add($button_quit)
$Image = [system.drawing.image]::FromFile("C:\Temp\2014-03-26.jpg")
$Form.BackgroundImage = $Image
$Form.BackgroundImageLayout = "center"
function action1
{
$FolderDialog = New-Object System.Windows.Forms.FolderBrowserDialog
$FolderDialog.ShowDialog() | Out-Null
$outDir = $FolderDialog.SelectedPath
$Label = New-Object System.Windows.Forms.Label
$Label.Text = "$outDir"
$Label.AutoSize = $True
$form.controls.Add($Label)
}
$button_1 = New-Object System.Windows.Forms.Button
$button_1.Text = "Parcourir..."
$button_1.AutoSize = $True
$button_1.Size = New-Object System.Drawing.Size(245,30)
$button_1.Location = New-Object System.Drawing.Size(5,180)
$button_1.Add_Click({action1})
$Form.Controls.Add($button_1)
$Form.ShowDialog()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment