Capture combobox changed event

Welcome Forums General PowerShell Q&A Capture combobox changed event

This topic contains 2 replies, has 3 voices, and was last updated by

4 years, 3 months ago.

  • Author
  • #23930

    Topics: 11
    Replies: 13
    Points: 0
    Rank: Member

    Struggling to find a starting point on how to capture a combobox change event.

    All i'm looking to do is update combobox2, from the selection of combobox1 dropdown list. I.e. Select Accountant in combobox1 dropdown list, combobox2 automatically updates with OU Accounts.

    Could anyone give me a starting point on how this should look?


  • #23948

    Topics: 13
    Replies: 4872
    Points: 1,842
    Helping HandTeam Member
    Rank: Community Hero covers the docs for the control; there's a change* event. You bind it the same way you'd bing the Click event for a button. I'm not sure if you're using PowerShell Studio; if you are, you should be able to right-click the control in the designer and add the code for the change event.

    *Specifically, SelectedIndexChange or SelectedValueChange are probably what you want, depending on how the control's behavior is configured.

  • #23973

    Topics: 18
    Replies: 573
    Points: 32
    Rank: Member

    $combobox1_SelectedIndexChanged = { write-host $combobox1.Text}

The topic ‘Capture combobox changed event’ is closed to new replies.