【发布时间】:2018-11-19 14:13:29
【问题描述】:
我创建了一个 powershell gui,我想在我的 windows.form 中插入一个图标。
我是这样做的,我用 ps2exe 生成了一个 exe 文件。
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
#region begin GUI{
$Form = New-Object system.Windows.Forms.Form
$Form.ClientSize = '400,230'
$Form.text = "Test"
$Form.TopMost = $false
$Icon = New-Object system.drawing.icon (".\icon\test.ico")
$Form.Icon = $Icon
如果我将带有图标 test.ico 的 dir 图标与我的 exe 一起使用,一切都会很好,但现在我会将图标合并到我的代码中,而不必将图标目录与我的 exe 一起带来。
有可能吗?如果有,怎么做?
【问题讨论】:
标签: powershell