I am using Visual Basic Express 2010 edition. I have a combo box named cboTester, an output combobox called cboOutput and a separate class called 'ListClass'
The cboTester has 3 options, EN, FR and DE.
In the list class I have 3 string arrays;
Public Shared Tester_EN() {"Yes", "No"}
Public Shared Tester_FR() {"Maybe", "Kind of"}
Public Shared Tester_DE() {"No", "No way"}
Is there a way using vb.net that I can use the input from the cboTester do determine how cboOutput is populated?
I was thinking it would something similar to the answer detailed below. Please note; this is written free-type and not copied and pasted from somewhere I can check it!
private sub cboTester_SelectedIndexChanged()
if cboTester_SelectedItem = "EN" then
strTest = "EN"
else if cboTester_SelectedItem = "FR" then
strTest = "FR" ...
end if
ArrayName = "ListClass.Tester_" & strTest
cboOutput.items.addrange(ArrayName)
--- EDIT BELOW THE LINE 14/06/2013 2:45AM GMT It seems like I could do with giving a bit more information here.
The reason why I want to do it like this is because I have lots and lots of arrays, which are set up with the description of Arrayname_Lang (eg. Reasons_EN, Reasons_FR, Reasons_DE, House_EN, House_FR,House_DE) So I want to be able to write my load functions as;
cboReasons.Items.AddRange("ListClass.reasons" & language)
rather than having to write each possible variant
Thanks Maudise