Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- 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:
- Add-Type -AssemblyName System.Windows.Forms
- $form = New-Object System.Windows.Forms.Form
- $form.Text = "Text Box Example"
- $form.Size = New-Object System.Drawing.Size(400, 300)
- $textbox = New-Object System.Windows.Forms.TextBox
- $textbox.Location = New-Object System.Drawing.Point(50, 50)
- $textbox.Size = New-Object System.Drawing.Size(300, 150)
- $textbox.Font = New-Object System.Drawing.Font("Arial", 100)
- $textbox.ForeColor = "Green"
- $form.Controls.Add($textbox)
- $form.ShowDialog() | Out-Null
- 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.
- Share
- Start chat...
- chatgptweb.org realistic unlimited experience of AI.
Add Comment
Please, Sign In to add comment