gpt-4-0314· OpenAI
Arena Human Preference 55K
write a powershell script that creates a gui message box with an okay button and a…
- User
write a powershell script that creates a gui message box with an okay button and a message that is 400 x 225
- Assistant
You can use the following PowerShell script to create a GUI message box with the specified dimensions and an "OK" button. Save the script in a .ps1 file and run it on a Windows machine.
# Load necessary assemblies Add-Type -AssemblyName System.Windows.Forms # Create the message box form $form = New-Object System.Windows.Forms.Form # Set form properties $form.Text = 'Message Box' $form.Size = New-Object System.Drawing.Size(400, 225) $form.StartPosition = 'CenterScreen' $form.FormBorderStyle = 'FixedSingle' $form.MaximizeBox = $false # Create the label for the message $label = New-Object System.Windows.Forms.Label $label.Text = 'This is your custom message.' $label.AutoSize = $true $label.Location = New-Object System.Drawing.Point(20, 20) # Create the OK button $okButton = New-Object System.Windows.Forms.Button $okButton.Text = 'OK' $okButton.Width = 60 $okButton.Height = 30 $okButton.Location = New-Object System.Drawing.Point(160, 150) # Add a click event for the OK button $okButton.Add_Click({$form.Close()}) # Add controls to the form $form.Controls.Add($label) $form.Controls.Add($okButton) # Show the message box $form.ShowDialog()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.