小编D R*_*ert的帖子

如何在powershell中添加计时器以在一定时间后退出表单

我在 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)

powershell timer winforms

1
推荐指数
1
解决办法
2992
查看次数

标签 统计

powershell ×1

timer ×1

winforms ×1