i have just made a simple powershell gui. you can find the code below. it is running fine. how can i add a tab to my existing gui, so that i have a second part where i can add some actions, like another button with a action behind it.
$objForm = New-Object System.Windows.Forms.Form
$objForm.Text = "testgui"
$objForm.Size = New-Object System.Drawing.Size(350,680)
$objForm.BackColor = "Black"
$objForm.StartPosition = "CenterScreen"
$objForm.FormBorderStyle = 'Fixed3D'
$objForm.MaximizeBox = $false
$objForm.KeyPreview = $True
$objForm.Topmost = $false
$installed_button = New-Object system.windows.Forms.Button
$installed_button.Text = "button 1"
$installed_button.ForeColor = "White"
$installed_button.backColor = "blue"
$installed_button.Cursor = [System.Windows.Forms.Cursors]::Hand
$installed_button.Width = 150
$installed_button.Height = 40
$installed_button.Add_Click({
start-process
})
$installed_button.location = new-object system.drawing.point(10,50)
$obJForm.controls.Add($installed_button)
$installed_button = New-Object system.windows.Forms.Button
$installed_button.Text = "button 2"
#$installed_button.AutoSize = $true
$installed_button.ForeColor = "White"
$installed_button.backColor = "red"
$installed_button.Cursor = [System.Windows.Forms.Cursors]::Hand
$installed_button.Width = 150
$installed_button.Height = 40
$installed_button.Add_Click({
start-process
})
$installed_button.location = new-object system.drawing.point(180,50)
$obJForm.controls.Add($installed_button)
$objForm.Add_Shown({$objForm.Activate()})
[void] $objForm.ShowDialog()