Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function writemessage($input) {
- $wshell = New-Object -ComObject Wscript.Shell
- $wshell.Popup($input,0,"Done",0x1)
- }
- Add-Type -AssemblyName System.Windows.Forms
- $Form = New-Object system.Windows.Forms.Form
- $Form.Text = "Form"
- $Form.TopMost = $true
- $Form.Width = 356
- $Form.Height = 244
- $Form.StartPosition = "CenterScreen"
- $textBox2 = New-Object system.windows.Forms.TextBox
- $textBox2.Width = 100
- $textBox2.Height = 20
- $textBox2.location = new-object system.drawing.point(10,20)
- $textBox2.Font = "Microsoft Sans Serif,10"
- $Form.controls.Add($textBox2)
- [String]$variable
- $button4 = New-Object system.windows.Forms.Button
- $button4.Text = "button"
- $button4.Width = 60
- $button4.Height = 30
- $button4.Add_Click({
- $variable = "second"
- writemessage $variable
- })
- $button4.Click
- $button4.location = new-object system.drawing.point(55,75)
- $button4.Font = "Microsoft Sans Serif,10"
- $Form.controls.Add($button4)
- [void]$Form.ShowDialog($variable)
- $Form.Dispose()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement