So i’m creating my first tool. It has 3 tabpages , each with its own tasks.
Now, when the app gets loaded, all functions are loaded at once. (and so all tabs are loaded at once)
It would like to make it so that all functions get loaded when the tab if selected or clicked on.
so i have
#Tab Control $tabControl.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 75 $System_Drawing_Point.Y = 85 $tabControl.Location = $System_Drawing_Point $tabControl.Name = "tabControl" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 300 $System_Drawing_Size.Width = 575 $tabControl.Size = $System_Drawing_Size $form1.Controls.Add($tabControl)
and e.g.
#SQLHealth Page $SQLHealthPage.DataBindings.DefaultDataSourceUpdateMode = 0 $SQLHealthPage.UseVisualStyleBackColor = $True $SQLHealthPage.Name = "SQLHealthPage" $SQLHealthPage.Text = "SQL Health Check" $tabControl.Controls.Add($SQLHealthPage) #CPU Page $CPUPage.DataBindings.DefaultDataSourceUpdateMode = 0 $CPUPage.UseVisualStyleBackColor = $True $CPUPage.Name = "CPU" $CPUPage.Text = "CPU" $tabControl.Controls.Add($CPUPage)
i tried the following but that doesn’t work.
if ($TabControl.SelectedTab = $CPUPage) { Write-Host "hello tab cpuPage" }