Hello,
I'm new in powershell
I've got a hashtable (let's say HashTable1) built from an ini file:
[Section1]
a="1.1"
b="2.1"
c="2.6"
In the console, printing $HashTable1.Section1 returns :
Name Value
===== =====
a "1.1"
b "2.1"
c "2.6"
In my GUI, I would like to populate a combobox with the Keys of the hash table (a, b, c)
When the user selects an item in the combobox, the textbox would be filled with the correct value of the hashtable ("1.1", "2.1" or "2.6")
How can I do that ?
#Parsing ini file
$Fichier_Config_INI = Get-IniContent("D:\Config.ini")
I've linked my hash table to the datasource of the combobox :
$combobox_test.DataSource = $Fichier_Config_INI.Section1.Keys | % tostring
And then write the event of the combobox :
$combobox_test_SelectedIndexChanged={
#TODO: Place custom script here
$textbox_test.Text= ?????
Thanks very much for your help
Regards
Combobox, textbox and hashtable
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Combobox, textbox and hashtable
Thanks for your help. I will try this evening.
What about displaying in the textbox the value of the hash table corresponding to thé hashtable Key selected in the combobox ?
Thanks
What about displaying in the textbox the value of the hash table corresponding to thé hashtable Key selected in the combobox ?
Thanks