Powershell Help - Comboboxes

Welcome Forums General PowerShell Q&A Powershell Help - Comboboxes

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

1 year, 11 months ago.

  • Author
  • #66835

    Points: 0
    Rank: Member

    I am rather new to Powershell coding and trying to cut down on some code.

    I have multiple ComboBoxes that have the same selection.

    How can I use the same lists for different Comboboxes but using minimum code?

    i.e. I have 10 Comboboxes that have the lists of Please Select, Yes, No.
    How can I get them to use the same line of code instead of individual code?

    #Adding Combobox Items to Toner Colour
        "Select","Yes","No" | ForEach-Object {$WPFcboPRToner.AddChild($_)}
        $WPFcboPRToner.SelectedIndex = 0

    So in the code I want other comboboxes to use this without duplicating code.

    Thanks All.


  • #66843

    Points: 1
    Rank: Member

    Add the line(s) of code to a variable and use the variable.

The topic ‘Powershell Help - Comboboxes’ is closed to new replies.

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