Powershell Comboboxes - DisplayMember and ValueMember
Posted: Mon Feb 03, 2014 12:24 pm
Hello,
I have been struggling to find out if powershell will allow comboboxes to behave like the .net version of comboboxes.
Within .net if you create a combobox, you are able to add a field to the combobox that shows text in the drop down. You can also specify the value for each item you see in that drop down.If i choose World War I from the drop down than i am expecting to be able to grab the value WWI and use it.
For Example:
Display Member:
World War I
World War II
World War III
Value Member:
WWI
WWII
WWIII
I've seen posts here about using the Load-Combobox function but that function doesnt seem to let you set the Value member. Has anyone else run into this? Currently i have a work around to create an array that holds the value member and than based on the selected index for the display member i just choose the same index in my array that is holding the value member. Very cludgy.
Please let me know what you think. Maybe im just going crazy.
Cheers,
I have been struggling to find out if powershell will allow comboboxes to behave like the .net version of comboboxes.
Within .net if you create a combobox, you are able to add a field to the combobox that shows text in the drop down. You can also specify the value for each item you see in that drop down.If i choose World War I from the drop down than i am expecting to be able to grab the value WWI and use it.
For Example:
Display Member:
World War I
World War II
World War III
Value Member:
WWI
WWII
WWIII
I've seen posts here about using the Load-Combobox function but that function doesnt seem to let you set the Value member. Has anyone else run into this? Currently i have a work around to create an array that holds the value member and than based on the selected index for the display member i just choose the same index in my array that is holding the value member. Very cludgy.
Please let me know what you think. Maybe im just going crazy.
Cheers,