Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Crear un formulario, añadir una etiqueta y un botón
- #Formulario
- $Form=New-Object System.Windows.Forms.Form
- $Form.Text="Compra online Media Mark"
- $Form.Size=New-Object System.Drawing.Size(500,500)
- $Form.StartPosition="CenterScreen"
- #Etiqueta
- $Label=New-Object System.Windows.Forms.Label
- $Label.Text="Elige una opcion: "
- $Label.AutoSize=$True
- $Label.Location=New-Object System.Drawing.Size(200,100)
- #Añadir etiqueta
- $Form.Controls.Add($Label)
- #Botón
- $Button=New-Object System.Windows.Forms.Button
- $Button.Size=New-Object System.Drawing.Size(80,23)
- $Button.Text="Registrate"
- $Button.Location=New-Object System.Drawing.Size(200,200)
- #Añadir botón
- $Form.Controls.Add($Button)
- $Button.add_click({
- #Crear un formulario, añadir una etiqueta y un botón
- #Formulario
- $Form2=New-Object System.Windows.Forms.Form
- $Form2.Text="Registrar"
- $Form2.Size=New-Object System.Drawing.Size(500,500)
- $Form2.StartPosition="CenterScreen"
- $label2 = New-Object System.Windows.Forms.Label
- $label2.Location = New-Object System.Drawing.Point(120,30)
- $label2.Size = New-Object System.Drawing.Size(280,20)
- $label2.Text = 'Introduce tus datos para registrarte'
- $form2.Controls.Add($label2)
- #nombre
- $textBox = New-Object System.Windows.Forms.TextBox
- $textBox.Location = New-Object System.Drawing.Point(150,110)
- $label3 = New-Object System.Windows.Forms.Label
- $label3.Location = New-Object System.Drawing.Point(50,110)
- $label3.Size = New-Object System.Drawing.Size(80,20)
- $label3.Text = 'Nombre :'
- $form2.Controls.Add($label3)
- $textBox.Size = New-Object System.Drawing.Size(260,20)
- $form2.Controls.Add($textBox)
- #apellido
- $textBox1 = New-Object System.Windows.Forms.TextBox
- $textBox1.Location = New-Object System.Drawing.Point(150,150)
- $label4 = New-Object System.Windows.Forms.Label
- $label4.Location = New-Object System.Drawing.Point(50,150)
- $label4.Size = New-Object System.Drawing.Size(80,20)
- $label4.Text = 'Apellido:'
- $form2.Controls.Add($label4)
- $textBox1.Size = New-Object System.Drawing.Size(260,20)
- $form2.Controls.Add($textBox1)
- #correo
- $textBox1 = New-Object System.Windows.Forms.TextBox
- $textBox1.Location = New-Object System.Drawing.Point(150,190)
- $label4 = New-Object System.Windows.Forms.Label
- $label4.Location = New-Object System.Drawing.Point(50,190)
- $label4.Size = New-Object System.Drawing.Size(80,20)
- $label4.Text = 'Correo:'
- $form2.Controls.Add($label4)
- $textBox1.Size = New-Object System.Drawing.Size(260,20)
- $form2.Controls.Add($textBox1)
- #contraseña
- $textBox1 = New-Object System.Windows.Forms.TextBox
- $textBox1.Location = New-Object System.Drawing.Point(150,230)
- $label5 = New-Object System.Windows.Forms.Label
- $label5.Location = New-Object System.Drawing.Point(50,230)
- $label5.Size = New-Object System.Drawing.Size(80,20)
- $label5.Text = 'Contraseña:'
- $form2.Controls.Add($label5)
- $textBox1.Size = New-Object System.Drawing.Size(260,20)
- $form2.Controls.Add($textBox1)
- #Botón registrar
- $Button5=New-Object System.Windows.Forms.Button
- $Button5.Size=New-Object System.Drawing.Size(75,23)
- $Button5.Text="Registrar"
- $Button5.Location=New-Object System.Drawing.Size(150,300)
- #Añadir botón resgistrar
- $Form2.Controls.Add($Button5)
- $Form2.ShowDialog()
- #Botón volver
- $Button6=New-Object System.Windows.Forms.Button
- $Button6.Size=New-Object System.Drawing.Size(75,23)
- $Button6.Text="Volver"
- $Button6.Location=New-Object System.Drawing.Size(200,300)
- #Añadir botón volver
- $Form2.Controls.Add($Button5)
- $Form2.ShowDialog()
- #Añadir etiqueta
- $Form.Controls.Add($Label)
- })
- #Botón1
- $Button1=New-Object System.Windows.Forms.Button
- $Button1.Size=New-Object System.Drawing.Size(80,23)
- $Button1.Text="Acceder"
- $Button1.Location=New-Object System.Drawing.Size(200,250)
- #Añadir botón1
- $Form.Controls.Add($Button1)
- #Botón2
- $Button2=New-Object System.Windows.Forms.Button
- $Button2.Size=New-Object System.Drawing.Size(80,23)
- $Button2.Text="Promociones"
- $Button2.Location=New-Object System.Drawing.Size(200,300)
- #Añadir botón2
- $Form.Controls.Add($Button2)
- #Botón3
- $Button3=New-Object System.Windows.Forms.Button
- $Button3.Size=New-Object System.Drawing.Size(80,23)
- $Button3.Text="Salir"
- $Button3.Location=New-Object System.Drawing.Size(200,350)
- #Añadir botón3
- $Form.Controls.Add($Button3)
- #Defino el evento al hacer el clic
- $Button3.Add_Click({$Form.Close()})
- $Form.ShowDialog()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement