Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #requires -version 3
- $button1 = New-Object System.Windows.Forms.Button
- $button1.Location = New-Object System.Drawing.Point(10, 10)
- $button1.Size = New-Object System.Drawing.Size(75, 23)
- $button1.Text = "Blue"
- $button1.BackColor = "Blue"
- $button2 = New-Object System.Windows.Forms.Button
- $button2.Location = New-Object System.Drawing.Point(10, 43)
- $button2.Size = New-Object System.Drawing.Size(75, 23)
- $button2.Text = "Blue"
- $button2.BackColor = "Blue"
- $button3 = New-Object System.Windows.Forms.Button
- $button3.Location = New-Object System.Drawing.Point(10, 73)
- $button3.Size = New-Object System.Drawing.Size(75, 23)
- $button3.Text = "Blue"
- $button3.BackColor = "Blue"
- $button4 = New-Object System.Windows.Forms.Button
- $button4.Location = New-Object System.Drawing.Point(10, 103)
- $button4.Size = New-Object System.Drawing.Size(75, 23)
- $button4.Text = "Blue"
- $button4.BackColor = "Blue"
- $form = New-Object System.Windows.Forms.Form
- $form.Location = New-Object System.Drawing.Point(10, 10)
- $form.Size = New-Object System.Drawing.Size(400, 300)
- $form.BackColor = "White"
- $textDisplay = New-Object System.Windows.Forms.TextBox
- $textDisplay.Location = New-Object System.Drawing.Point(10, 150)
- $textDisplay.Size = New-Object System.Drawing.Size(390, 23)
- $textDisplay.Text = "Press a button to change the color"
- $form.Controls.Add($button1)
- $form.Controls.Add($button2)
- $form.Controls.Add($button3)
- $form.Controls.Add($button4)
- $form.TopMost = $true
- $form.Add_Shown($textDisplay)
- $application = New-Object System.Windows.Forms.Application
- $application.Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement