Neu organisiert für neues Schuljahr
This commit is contained in:
98
11fi5/powershell/ps-form.ps1
Normal file
98
11fi5/powershell/ps-form.ps1
Normal file
@ -0,0 +1,98 @@
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
|
||||
$form = New-Object System.Windows.Forms.Form -Property @{
|
||||
Text = 'Data Entry Form'
|
||||
Size = New-Object System.Drawing.Size(690,380)
|
||||
StartPosition = 'CenterScreen'
|
||||
}
|
||||
|
||||
$groupbox = New-Object System.Windows.Forms.GroupBox -Property @{
|
||||
Location = New-Object System.Drawing.Point(8,0)
|
||||
Size = New-Object System.Drawing.Size(350,300)
|
||||
Text = "Group Box"
|
||||
}
|
||||
|
||||
$textBoxVorname = New-Object System.Windows.Forms.TextBox -Property @{
|
||||
Location = New-Object System.Drawing.Point(($groupbox.Width-120-8), 40)
|
||||
Size = New-Object System.Drawing.Size(120,20)
|
||||
}
|
||||
|
||||
$textBoxName = New-Object System.Windows.Forms.TextBox -Property @{
|
||||
Location = New-Object System.Drawing.Point(($groupbox.Width-120-8), 68)
|
||||
Size = New-Object System.Drawing.Size(120,20)
|
||||
}
|
||||
|
||||
$labelWidth = 50
|
||||
|
||||
$labelVorname = New-Object System.Windows.Forms.Label -Property @{
|
||||
Text = "Vorname"
|
||||
Location = New-Object System.Drawing.Point(($groupbox.Width-120-$labelWidth-16), $textBoxVorname.Top)
|
||||
Size = New-Object System.Drawing.Size($labelWidth,20)
|
||||
TextAlign = 64
|
||||
}
|
||||
|
||||
$labelName = New-Object System.Windows.Forms.Label -Property @{
|
||||
Text = "Name"
|
||||
Location = New-Object System.Drawing.Point(($groupbox.Width-120-$labelWidth-16), $textBoxName.Top)
|
||||
Size = New-Object System.Drawing.Size($labelWidth,20)
|
||||
TextAlign = 64
|
||||
}
|
||||
|
||||
$attributeDistance = 24
|
||||
$marginBottom = 8
|
||||
|
||||
$checkBoxAzubi = New-Object System.Windows.Forms.CheckBox -Property @{
|
||||
Text = "Azubi"
|
||||
Location = New-Object System.Drawing.Point(8, ($groupbox.Height - $marginBottom - $attributeDistance*4))
|
||||
Size = New-Object System.Drawing.Size(80,20)
|
||||
TextAlign = 16
|
||||
}
|
||||
|
||||
$radioSingle = New-Object System.Windows.Forms.RadioButton -Property @{
|
||||
Text = "Single"
|
||||
Location = New-Object System.Drawing.Point(8, ($groupbox.Height - $marginBottom - $attributeDistance*3))
|
||||
Size = New-Object System.Drawing.Size(80,20)
|
||||
TextAlign = 16
|
||||
}
|
||||
|
||||
$radioVergeben = New-Object System.Windows.Forms.RadioButton -Property @{
|
||||
Text = "Vergeben"
|
||||
Location = New-Object System.Drawing.Point(8, ($groupbox.Height - $marginBottom - $attributeDistance*2))
|
||||
Size = New-Object System.Drawing.Size(80,20)
|
||||
TextAlign = 16
|
||||
}
|
||||
|
||||
$comboBox = New-Object System.Windows.Forms.ComboBox -Property @{
|
||||
Text = "comboBox"
|
||||
Location = New-Object System.Drawing.Point(8, ($groupbox.Height - $marginBottom - $attributeDistance*1))
|
||||
Size = New-Object System.Drawing.Size(120,20)
|
||||
}
|
||||
|
||||
$picture = New-Object System.Windows.Forms.PictureBox -Property @{
|
||||
Location = New-Object System.Drawing.Point(8, 16)
|
||||
Size = New-Object System.Drawing.Size(($groupbox.Width-200-24), ($groupbox.Height - $marginBottom - $attributeDistance*4 - 24))
|
||||
SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::AutoSize
|
||||
BackgroundImage = [System.Drawing.Image]::FromFile("C:\Users\krume\OneDrive - Klara-Oppenheimer-Schule\neuland logo.png")
|
||||
}
|
||||
|
||||
$groupbox.Controls.AddRange($($textBoxVorname, $textBoxName, $labelVorname, $labelName, $checkBoxAzubi, $radioSingle, $radioVergeben, $comboBox, $picture))
|
||||
|
||||
$form.Controls.Add($groupbox)
|
||||
|
||||
$listBox = New-Object System.Windows.Forms.ListBox -Property @{
|
||||
Location = New-Object System.Drawing.Point(($groupbox.Width + $groupbox.Left + 8), 8)
|
||||
Size = New-Object System.Drawing.Size(300, 300)
|
||||
}
|
||||
|
||||
$button = New-Object System.Windows.Forms.Button -Property @{
|
||||
Text = "Knopf"
|
||||
Location = New-Object System.Drawing.Point(($listBox.Left + $listBox.Width - 100), 302)
|
||||
Size = New-Object System.Drawing.Size(100, 30)
|
||||
|
||||
}
|
||||
|
||||
$form.Controls.Add($listBox)
|
||||
$form.Controls.Add($button)
|
||||
|
||||
$form.Topmost = $true
|
||||
$form.ShowDialog()
|
||||
Reference in New Issue
Block a user