Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. #Crear un formulario, añadir una etiqueta y un botón
  2. #Formulario
  3. $Form=New-Object System.Windows.Forms.Form
  4. $Form.Text="Compra online Media Mark"
  5. $Form.Size=New-Object System.Drawing.Size(500,500)
  6. $Form.StartPosition="CenterScreen"
  7.  
  8.  
  9. #Etiqueta
  10. $Label=New-Object System.Windows.Forms.Label
  11. $Label.Text="Elige una opcion: "
  12. $Label.AutoSize=$True
  13. $Label.Location=New-Object System.Drawing.Size(200,100)
  14. #Añadir etiqueta
  15. $Form.Controls.Add($Label)
  16.  
  17.  
  18. #Botón
  19. $Button=New-Object System.Windows.Forms.Button
  20. $Button.Size=New-Object System.Drawing.Size(80,23)
  21. $Button.Text="Registrate"
  22. $Button.Location=New-Object System.Drawing.Size(200,200)
  23. #Añadir botón
  24. $Form.Controls.Add($Button)
  25. $Button.add_click({
  26. #Crear un formulario, añadir una etiqueta y un botón
  27. #Formulario
  28. $Form2=New-Object System.Windows.Forms.Form
  29. $Form2.Text="Registrar"
  30. $Form2.Size=New-Object System.Drawing.Size(500,500)
  31. $Form2.StartPosition="CenterScreen"
  32.  
  33. $label2 = New-Object System.Windows.Forms.Label
  34. $label2.Location = New-Object System.Drawing.Point(120,30)
  35. $label2.Size = New-Object System.Drawing.Size(280,20)
  36. $label2.Text = 'Introduce tus datos para registrarte'
  37. $form2.Controls.Add($label2)
  38. #nombre
  39. $textBox = New-Object System.Windows.Forms.TextBox
  40. $textBox.Location = New-Object System.Drawing.Point(150,110)
  41. $label3 = New-Object System.Windows.Forms.Label
  42. $label3.Location = New-Object System.Drawing.Point(50,110)
  43. $label3.Size = New-Object System.Drawing.Size(80,20)
  44. $label3.Text = 'Nombre :'
  45. $form2.Controls.Add($label3)
  46. $textBox.Size = New-Object System.Drawing.Size(260,20)
  47. $form2.Controls.Add($textBox)
  48. #apellido
  49. $textBox1 = New-Object System.Windows.Forms.TextBox
  50. $textBox1.Location = New-Object System.Drawing.Point(150,150)
  51. $label4 = New-Object System.Windows.Forms.Label
  52. $label4.Location = New-Object System.Drawing.Point(50,150)
  53. $label4.Size = New-Object System.Drawing.Size(80,20)
  54. $label4.Text = 'Apellido:'
  55. $form2.Controls.Add($label4)
  56. $textBox1.Size = New-Object System.Drawing.Size(260,20)
  57. $form2.Controls.Add($textBox1)
  58. #correo
  59. $textBox1 = New-Object System.Windows.Forms.TextBox
  60. $textBox1.Location = New-Object System.Drawing.Point(150,190)
  61. $label4 = New-Object System.Windows.Forms.Label
  62. $label4.Location = New-Object System.Drawing.Point(50,190)
  63. $label4.Size = New-Object System.Drawing.Size(80,20)
  64. $label4.Text = 'Correo:'
  65. $form2.Controls.Add($label4)
  66. $textBox1.Size = New-Object System.Drawing.Size(260,20)
  67. $form2.Controls.Add($textBox1)
  68. #contraseña
  69. $textBox1 = New-Object System.Windows.Forms.TextBox
  70. $textBox1.Location = New-Object System.Drawing.Point(150,230)
  71. $label5 = New-Object System.Windows.Forms.Label
  72. $label5.Location = New-Object System.Drawing.Point(50,230)
  73. $label5.Size = New-Object System.Drawing.Size(80,20)
  74. $label5.Text = 'Contraseña:'
  75. $form2.Controls.Add($label5)
  76. $textBox1.Size = New-Object System.Drawing.Size(260,20)
  77. $form2.Controls.Add($textBox1)
  78.  
  79. #Botón registrar
  80. $Button5=New-Object System.Windows.Forms.Button
  81. $Button5.Size=New-Object System.Drawing.Size(75,23)
  82. $Button5.Text="Registrar"
  83. $Button5.Location=New-Object System.Drawing.Size(150,300)
  84. #Añadir botón resgistrar
  85. $Form2.Controls.Add($Button5)
  86. $Form2.ShowDialog()
  87. #Botón volver
  88. $Button6=New-Object System.Windows.Forms.Button
  89. $Button6.Size=New-Object System.Drawing.Size(75,23)
  90. $Button6.Text="Volver"
  91. $Button6.Location=New-Object System.Drawing.Size(200,300)
  92. #Añadir botón volver
  93. $Form2.Controls.Add($Button5)
  94. $Form2.ShowDialog()
  95.  
  96.  
  97. #Añadir etiqueta
  98. $Form.Controls.Add($Label)
  99.  
  100. })
  101.  
  102.  
  103.  
  104. #Botón1
  105. $Button1=New-Object System.Windows.Forms.Button
  106. $Button1.Size=New-Object System.Drawing.Size(80,23)
  107. $Button1.Text="Acceder"
  108. $Button1.Location=New-Object System.Drawing.Size(200,250)
  109. #Añadir botón1
  110. $Form.Controls.Add($Button1)
  111.  
  112.  
  113. #Botón2
  114. $Button2=New-Object System.Windows.Forms.Button
  115. $Button2.Size=New-Object System.Drawing.Size(80,23)
  116. $Button2.Text="Promociones"
  117. $Button2.Location=New-Object System.Drawing.Size(200,300)
  118. #Añadir botón2
  119. $Form.Controls.Add($Button2)
  120.  
  121.  
  122. #Botón3
  123. $Button3=New-Object System.Windows.Forms.Button
  124. $Button3.Size=New-Object System.Drawing.Size(80,23)
  125. $Button3.Text="Salir"
  126. $Button3.Location=New-Object System.Drawing.Size(200,350)
  127. #Añadir botón3
  128. $Form.Controls.Add($Button3)
  129. #Defino el evento al hacer el clic
  130. $Button3.Add_Click({$Form.Close()})
  131.  
  132.  
  133.  
  134.  
  135. $Form.ShowDialog()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement