1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
using assembly System.Windows.Forms using namespace System.Windows.Forms $form = [Form] @{ Text = 'Mi formulario' } $button = [Button] @{ Text = 'Pulsar' Location = [System.Drawing.Size]::new(100,100) BackColor = '#CCCC99' } $button2 = [Button] @{ Text = 'No Pulsar' Location = [System.Drawing.Size]::new(100,200) Enabled = $false BackColor = '#99CC99' } $button.add_Click{ start cmd } $button2.add_Click{ start notepad } $form.Controls.Add($button) $form.Controls.Add($button2) $form.ShowDialog() |