如何在powershell GUI中为tabcontrol启用滚动按钮

时间:2017-02-13 16:16:23

标签: winforms powershell user-interface

我正在努力,因为我无法找到一个可以为我的PowerShell脚本添加滚动按钮的命令。我在脚本中有多个选项卡。现在我有更多的选项卡,而不是适合脚本窗口。如何启用我可以在powershell gui标签之间切换的滚动按钮?

很抱歉没有添加脚本。

################ Forms ########################

$Form = New-Object System.Windows.Forms.Form
$Form.size = New-Object System.Drawing.Size(505,570)
$form.text = "Integrated"


################ Tabs ########################
$tabcontrols = New-Object System.Windows.Forms.TabControl
$tabcontrols.Size = New-Object System.Drawing.Size(605,570)

$form.Controls.Add($tabcontrols)

$tabMailboxScript = New-Object System.Windows.Forms.TabPage
$tabMailboxScript.Text = "Mailbox details"
$tabcontrols.Controls.Add($tabMailboxScript)

$tabCFGOwnerScript = New-Object System.Windows.Forms.TabPage
$tabCFGOwnerScript.Text = "CFG Owner"
$tabcontrols.Controls.Add($tabCFGOwnerScript)

$tabGetACLScript = New-Object System.Windows.Forms.TabPage
$tabGetACLScript.Text = "Get-ACL"
$tabcontrols.Controls.Add($tabGetACLScript)

$tabCFGFolderScript = New-Object System.Windows.Forms.TabPage
$tabCFGFolderScript.Text = "CFG Folder"
$tabcontrols.Controls.Add($tabCFGFolderScript)

1 个答案:

答案 0 :(得分:1)

通过查看class's MSDN page,我可以看出,将标签更改为滚动选区似乎不受支持。您可以将其设置为允许多行选项卡,或者您应该能够隐藏选项卡选择器并设置自己的按钮以在选项卡之间滚动,然后只显示标签或某些内容以显示当前选项卡的内容。