PrimalForms/PowerShell – Event Behavior: Button Click and Switch Tab

I decided that I would post how to code a few Event Behaviors that could be coded with PowerShell using PrimalForms. You could just use your basic PowerShell Editor but PrimalForms is just my tool of choice.

So I start with a basic form (Two Tabs and a Button)

Then on the Events tab of $button1, double click ‘click’

Add the following code to the Event handler:

#TODO: Place custom script here
     If ($tabpage1.Visible -eq $true) {
     ElseIf ($tabpage2.Visible -eq $true) {

Clicking the button switches from tab to tab. Way cool!