Capture combobox changed event

This topic contains 2 replies, has 3 voices, and was last updated by  Dan Potter 3 years, 2 months ago.

  • Author
  • #23930


    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

    Don Jones
    Keymaster 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

    Dan Potter

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

You must be logged in to reply to this topic.