Powershell ComboBox Selection

Welcome Forums General PowerShell Q&A Powershell ComboBox Selection

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 11 months ago.

  • Author
  • #65182

    Points: 0
    Rank: Member

    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.

    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?

  • #65185

    Points: 21
    Rank: Member

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

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

The topic ‘Powershell ComboBox Selection’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort