我在 PowerShell 中创建了一个带有单选按钮的表单(仍在进行中),我希望将其在屏幕上显示一段时间,如果该时间已过,它将发送一封电子邮件并关闭表单。我不清楚如何将计时器添加到表单中,其余的我可以弄清楚。
$RadioButtonList = @( "Tom", "Dick", "Harry", "John", "Jane" )
$RadioButtonYMargin = 10
$RadioButtonIndex = 0
$RadioButtonX = 20
$RadioButtonY = (10 + $RadioButtonYMargin)
$RadioButtonYOffset = 30
$RadioButtonWidth = 350
$RadioButtonHeight = 20
$GroupBoxXMargin = 7
$GroupBoxX = 20
$GroupBoxY = 30
$GroupBoxWidth = 400
$GroupBoxHeight = $RadioButtonY + ( $RadioButtonList.Count * ( $RadioButtonHeight + 9 )) + $RadioButtonYMargin
$ButtonYMargin = 50
$ButtonY = $GroupBoxY + $GroupBoxHeight + $ButtonYMargin
$ButtonWidth = 100
$ButtonHeight = 40
$FormWidth = $GroupBoxWidth …Run Code Online (Sandbox Code Playgroud)