Hi all
I was wondering if someone could help
I have a number of tabs in a tabcontrol if a specific tab is selected I want to perform an action. I am unsure of how to set this up
Example:
if
(tab1.selected = $true){
write-host 'Tab one selected'
}
if
(tab2.selected = $true){
write-host 'Tab two selected'
}
Thanks in advance
Selected Tab Validation
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.
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.
Re: Selected Tab Validation
There is an event that is fired when the tab is selected.
Look at the events for the tab control.
The event is the 'Click' event and the tab is found by looking at:
$tabcontrol1.SelectedTab.Text
Look at the events for the tab control.
The event is the 'Click' event and the tab is found by looking at:
$tabcontrol1.SelectedTab.Text
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Re: Selected Tab Validation
I have had a look at this but am unable to find how to do thisjvierra wrote:There is an event that is fired when the tab is selected.
Look at the events for the tab control.
The event is the 'Click' event and the tab is found by looking at:
$tabcontrol1.SelectedTab.Text
Any chance you could send me a demo pff?
I have:
2 tabs
if tab two is clicked a message box will appear
sounds simple but got me stumped!!
Thanks in advance
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Re: Selected Tab Validation
Worked it out
I was using
I was using
PowerShell Code
Double-click the code block to select all.if($tabcontrol1.SelectedTab = $taberror){Write-Host 'error tab'}instead of
PowerShell Code
Double-click the code block to select all.if($tabcontrol1.SelectedTab -eq $taberror){Write-Host 'error tab'}Thank you for your help