简体   繁体   中英

How to enable scroll buttons for tabcontrol in powershell GUI

I am struggling as I am unable to find a command that would add Scroll buttons for my powershell Script. I have multiple tabs within scripts. Now I have more tabs than can fit in script window. How to enable Scroll buttons that I could switch between the powershell gui tabs?

Sorry for not adding the script.

################ 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)

From what I can tell by looking at the class's MSDN page , changing the tabs to a scrolling selection doesn't appear to be supported. You can set it to allow multiple rows of tabs, or you should be able to hide the tab selector and setup your own buttons to scroll between tabs, and then just display a label or something to show what the current tab is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM