0
我已經嘗試了下面的代碼來顯示ListViewbox中的輸出。但我無法在框中顯示任何輸出。如何以Powershell GUI ListViewbox的表格格式顯示輸出?
Add-Type -AssemblyName System.Windows.Forms
$Form = New-Object system.Windows.Forms.Form
$Form.Text = "Form"
$Form.TopMost = $true
$Form.Width = 696
$Form.Height = 323
$button2 = New-Object system.windows.Forms.Button
$button2.Text = "Go"
$button2.Width = 60
$button2.Height = 30
$button2.Add_Click({
$listView3.Text = Get-Process | Out-String
})
$button2.location = new-object system.drawing.point(238,70)
$button2.Font = "Microsoft Sans Serif,10"
$Form.controls.Add($button2)
$listView3 = New-Object system.windows.Forms.ListView
$listView3.Text = "listView"
$listView3.Width = 330
$listView3.Height = 600
$listView3.location = new-object system.drawing.point(269,146)
$Form.controls.Add($listView3)
[void]$Form.ShowDialog()
$Form.Dispose()
我需要在列表框中顯示的表格式輸出以及..在此先感謝....
謝謝你,我現在能夠查看輸出。此外,我需要顯示在格式表.. –
嘗試'$ listView3.View =「詳細信息」'。您可能需要添加您想要作爲子項目查看的列。我會給我的答案添加一個例子。 –