Author Posts

February 24, 2017 at 10:41 am

Morning All,
I am trying to use a Combobox to select three options.
The first option hides a Labal & txtbox – The Second & Third show the Label & Textbox.
I am currently having problems getting the code to work.


$cboSpecialHandling.Add_Click({
If cboSpecialHandling.Text -eq "None") {$lbl.visible = $False}
If cboSpecialHandling.Text -eq "Bob") {$lbl.visible = $True}
})

The above works but I have to click the Combobox twice.

I have tried the SelectedItemChanged and get nothing.

Can anyone advise?

February 24, 2017 at 10:58 am

Here is how we use the boolean assuming 'none' is the first item in your combobox.

$combobox1_SelectedIndexChanged={
$label1.Visible = ($combobox1.SelectedIndex -gt 0)
}