【发布时间】:2015-02-25 15:36:53
【问题描述】:
我正在使用 Windows Windows.Forms.RichTextBox 重定向我的 powershell 脚本输出“$var”。 Detect.Urls 已启用并正常工作,但无法通过单击打开它们。
谁能帮我写一下powershell脚本中的链接点击事件处理程序的代码......
$outputBox = New-Object System.Windows.Forms.RichTextBox
$outputBox.Location = New-Object System.Drawing.Size(10,150)
$outputBox.Size = New-Object System.Drawing.Size(700,300)
$outputBox.MultiLine = $True
$outputBox.SelectionIndent = 8
$outputBox.SelectionHangingIndent = 3
$outputBox.SelectionRightIndent = 12
$outputBox.ScrollBars = "ForcedBoth"
$Form.Controls.Add($outputBox)
$outputBox.Text = $var
$Form.Add_Shown({$Form.Activate()})
[void] $Form.ShowDialog()
【问题讨论】:
标签: powershell richtextbox powershell-3.0 powershell-ise