ljw20090730 2022-10-03 11:02 采纳率: 9.5%
浏览 6
已结题

Powershell图形界面窗口关闭提示框

Add-Type -AssemblyName System.Windows.Forms

$PowerShellForms = New-Object System.Windows.Forms.Form
$PowerShellForms.ClientSize = New-Object System.Drawing.Size(960, 720)
$PowerShellForms.MinimumSize = $PowerShellForms.Size
$PowerShellForms.BackColor = 'black'

$PowerShellForms.Add_FormClosing([System.Windows.Forms.FormClosingEventHandler]{
    $a = [System.Windows.Forms.MessageBox]::Show($PowerShellForms, '你确定要退出程序吗?', '退出程序', [System.Windows.Forms.MessageBoxButtons]::OKCancel, [System.Windows.Forms.MessageBoxIcon]::Question, [System.Windows.Forms.MessageBoxDefaultButton]::Button1)
})

$PowerShellForms.ShowDialog()

我用Windows的powershell制作一个GUI程序,现在想要一个关闭窗口的确认框,却怎么也做不到,我应该怎么办?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 10月11日
    • 创建了问题 10月3日

    悬赏问题

    • ¥15 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码