Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-Type -AssemblyName System.Windows.Forms
- function button1_click() {
- [Windows.Forms.MessageBox]::Show("hello!")
- }
- $form1 = New-Object System.Windows.Forms.Form
- $form1.Text = "greeting"
- $button1 = New-Object System.Windows.Forms.Button
- $button1.Text = "hello"
- $button1.Top = 100
- $button1.Left = 100
- $button1.Add_Click({button1_click})
- $form1.Controls.Add($button1)
- $form1.ShowDialog()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement