【问题标题】:How to enable scroll buttons for tabcontrol in powershell GUI如何在 Powershell GUI 中为 tabcontrol 启用滚动按钮
【发布时间】:2017-07-01 17:04:15
【问题描述】:

我正在苦苦挣扎,因为我找不到可以为我的 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)

【问题讨论】:

标签: winforms powershell user-interface


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-04
    • 2013-10-09
    相关资源
    最近更新 更多