Disable tab in tabcontrol based upon value

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Post Reply
User avatar
stevens
Posts: 419
Joined: Wed Jun 15, 2016 2:26 am

Disable tab in tabcontrol based upon value

Post by stevens »

Hi,

I have the code to remove a tab in a tabcontrol,
That's
$tabcontrol.TabPages.Remove($tab)

but how can I disable a tab (actually multiple only focussing on one) based upon a certain value in a grid.

Just need to code to disable it, then I can work it out :-)
Thanks.

jvierra
Posts: 14573
Joined: Tue May 22, 2007 9:57 am
Answers: 1
Been upvoted: 1 time
Contact:

Re: Disable tab in tabcontrol based upon value

Post by jvierra »

Only one tab can be enabled at a time and that is the one that is visible. Just make the tab you want the visible tab.

If you are asking how to prevent a user from changing tabs then just catch the tab changing even and throw it away. This is the easiest way to control navigation.

Post Reply