Obtaining Index value of dictionary
Posted
by
Maudise
on Stack Overflow
See other posts from Stack Overflow
or by Maudise
Published on 2013-06-23T23:39:53Z
Indexed on
2013/06/24
16:21 UTC
Read the original article
Hit count: 128
vb.net
|dictionary
I have a piece of code which looks at the following
public Test As Dictionary(Of String, String())
Which is brought in
tester = New Dictionary(Of String, String())
tester.add("Key_EN", {"Option 1_EN", "Option 2_EN", "Option 3_EN"})
tester.add("Key_FR", {"Option 1_FR", "Option 2_FR", "Option 3_FR"})
tester.add("Key_DE", {"Option 1_DE", "Option 2_DE", "Option 3_DE"})
There's then a combo box which looks at the following
dim Language as string
Language = "_EN" ' note this is done by a drop down combo box to select _EN or _FR etc.
cboTestBox.items.AddRange(tester("Key" & Language))
What I need to be able to do is to see what index position the answer is in and convert it back to the Key_EN.
So, for example _DE is selected, then the options of "Option 1_DE", "Option 2_DE", "Option 3_DE" would be displayed. If they chose Option 3_DE then I need to be able to convert this to Option 3_EN.
Many thanks Maudise
© Stack Overflow or respective owner