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 27 28 29 30 31 32 33 |
$buttons_functionslist=@(1..9) $loop = 0 # Formulario $Form = [System.Windows.Forms.Form]@{ Text = "Llamada" Size = New-Object System.Drawing.Size(410,200) StartPosition = "CenterScreen" } # Botones con los números while($loop -lt $buttons_functionslist.count) { $thisbutton = [System.Windows.Forms.Button]@{ Text = [string]$buttons_functionslist[$loop] Size = New-Object System.Drawing.Size(30,30) Location = New-Object System.Drawing.Size((10+(43*$loop)),80) } $thisbutton.Add_Click({ $TextBox.Text += $this.Text }) $Form.Controls.Add($thisbutton) $loop += 1 } # Texto con los números $TextBox = [System.Windows.Forms.TextBox]@{ Size = New-Object System.Drawing.Size(300,50) Location = New-Object System.Drawing.Size(40,30) } $Form.Controls.Add($TextBox) $Form.ShowDialog() |
