You've already forked SharedScripts
mirror of
https://github.com/jaapbrasser/SharedScripts.git
synced 2025-12-24 21:51:38 +02:00
Created Windows Forms input box
This commit is contained in:
@@ -20,6 +20,40 @@ param(
|
||||
[Microsoft.VisualBasic.Interaction]::MsgBox([convert]::ToBase64String([char[]]$_),0,$Title)
|
||||
}
|
||||
}
|
||||
'Windows.Forms' {
|
||||
$Form = New-Object System.Windows.Forms.Form -Property @{
|
||||
Text = $Title
|
||||
Size = New-Object System.Drawing.Size(300,150)
|
||||
StartPosition = "CenterScreen"
|
||||
Topmost = $true
|
||||
}
|
||||
|
||||
$FormText = New-Object System.Windows.Forms.Label -Property @{
|
||||
Location = New-Object System.Drawing.Size(10,20)
|
||||
Size = New-Object System.Drawing.Size(280,30)
|
||||
Text = "Let's convert this to base64"
|
||||
}
|
||||
|
||||
$FormInput = New-Object System.Windows.Forms.TextBox -Property @{
|
||||
Location = New-Object System.Drawing.Size(10,50)
|
||||
Size = New-Object System.Drawing.Size(260,20)
|
||||
}
|
||||
|
||||
$FormOKButton = New-Object System.Windows.Forms.Button -Property @{
|
||||
Location = New-Object System.Drawing.Size(130,75)
|
||||
Size = New-Object System.Drawing.Size(40,23)
|
||||
Text = "OK"
|
||||
}
|
||||
$FormOKButton.Add_Click({$Script:userInput=$FormInput.Text;$Form.Close()})
|
||||
|
||||
$Form.Controls.Add($FormText)
|
||||
$Form.Controls.Add($FormInput)
|
||||
$Form.Controls.Add($FormOKButton)
|
||||
$Form.ShowDialog()
|
||||
# | ForEach-Object {
|
||||
# [convert]::ToBase64String([char[]]$_)
|
||||
# }
|
||||
}
|
||||
default {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user