wetyukmnbxc

Untitled

Mar 5th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In powershell, give me an example of a GUI window form with a textbox of width 300 height 150 and text size is 100 and display font green colour.
  2.  
  3. Sure, here's an example code for creating a GUI window form with a textbox of width 300, height 150, text size 100, and display font green color in PowerShell:
  4.  
  5.  
  6. Add-Type -AssemblyName System.Windows.Forms
  7.  
  8. $form = New-Object System.Windows.Forms.Form
  9. $form.Text = "Text Box Example"
  10. $form.Size = New-Object System.Drawing.Size(400, 300)
  11.  
  12. $textbox = New-Object System.Windows.Forms.TextBox
  13. $textbox.Location = New-Object System.Drawing.Point(50, 50)
  14. $textbox.Size = New-Object System.Drawing.Size(300, 150)
  15. $textbox.Font = New-Object System.Drawing.Font("Arial", 100)
  16. $textbox.ForeColor = "Green"
  17.  
  18. $form.Controls.Add($textbox)
  19.  
  20. $form.ShowDialog() | Out-Null
  21.  
  22.  
  23. This code creates a new form with a title "Text Box Example" and a size of 400x300 pixels. It then creates a new textbox with a location of (50, 50) and a size of 300x150 pixels. The font of the textbox is set to Arial with a size of 100, and the text color is set to green. Finally, the textbox is added to the form, and the form is displayed using the `ShowDialog()` method.  
  24.  
  25. Share
  26. Start chat...
  27. chatgptweb.org realistic unlimited experience of AI.
Add Comment
Please, Sign In to add comment