Hi,
You may try the radio buttons from Windows Forms.
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.radiobutton
$Form = New-Object System.Windows.Forms.Form
$Form.Text = "Gender"
$Form.Size = New-Object System.Drawing.Size(300,200)
$Form.StartPosition = "CenterScreen"
$Label = New-Object system.Windows.Forms.Label
$Label.Text = "Please select user's gender"
$Label.AutoSize = $true
$Label.width = 25
$Label.height = 10
$Label.location = New-Object System.Drawing.Point(20,20)
$Form.Controls.Add($Label)
$RadioButtonMale = New-Object System.Windows.Forms.RadioButton
$RadioButtonMale.Location = New-Object System.Drawing.Point(50,50)
$RadioButtonMale.Size = New-Object System.Drawing.Size(75,25)
$RadioButtonMale.Text = "Male"
$Form.Controls.Add($RadioButtonMale)
$RadioButtonFemale = New-Object System.Windows.Forms.RadioButton
$RadioButtonFemale.Location = New-Object System.Drawing.Point(50,80)
$RadioButtonFemale.Size = New-Object System.Drawing.Size(75,25)
$RadioButtonFemale.Text = "Female"
$Form.Controls.Add($RadioButtonFemale)
$ButtonOK = New-Object System.Windows.Forms.Button
$ButtonOK.Location = New-Object System.Drawing.Point(75,120)
$ButtonOK.Size = New-Object System.Drawing.Size(75,25)
$ButtonOK.Text = "OK"
$ButtonOK.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $ButtonOK
$Form.Controls.Add($ButtonOK)
$ButtonCancel = New-Object System.Windows.Forms.Button
$ButtonCancel.Location = New-Object System.Drawing.Point(150,120)
$ButtonCancel.Size = New-Object System.Drawing.Size(75,25)
$ButtonCancel.Text = "Cancel"
$ButtonCancel.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$Form.CancelButton = $ButtonCancel
$Form.Controls.Add($ButtonCancel)
[void]$Form.ShowDialog()
if($RadioButtonMale.Checked){$result6 = "Male"}
elseif($RadioButtonFemale.Checked){$result6 = "Female"}
$result6
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.