Sofi0813
Member
- Joined
- Jul 25, 2021
- Messages
- 7
- Programming Experience
- 1-3
The labels display only the string (language0[0]) NOT array's value. It should pick up item from selected language array.
//Language array:
string[] language0 = { "Exercise 1", "Next", "Previous"};
string[] language1 = { "Övning 1", "Nästa", "Förgående"};
string[] language2 = { "blabla 1", "bla", "bla"};
int selectedLang = Dashboard.quantity;// selected language coming from Dashboard form. It is integers for ex. 0,1,2....
public void LanguageSetting()
{
String lang = "language" + selectedLang.ToString(); //make array name depending on selected language ex. language0, language1, language2
label1.Text = lang+"[0]"; // Want to display first item of selected array.
label2.Text = lang+"[1]"; //Want to display second item of selected array.
label3.Text = lang+"[2]"; //Want to display 3rd item of selected array.
}
//The labels display only the string (language0[0]) NOT array's value.
//Language array:
string[] language0 = { "Exercise 1", "Next", "Previous"};
string[] language1 = { "Övning 1", "Nästa", "Förgående"};
string[] language2 = { "blabla 1", "bla", "bla"};
int selectedLang = Dashboard.quantity;// selected language coming from Dashboard form. It is integers for ex. 0,1,2....
public void LanguageSetting()
{
String lang = "language" + selectedLang.ToString(); //make array name depending on selected language ex. language0, language1, language2
label1.Text = lang+"[0]"; // Want to display first item of selected array.
label2.Text = lang+"[1]"; //Want to display second item of selected array.
label3.Text = lang+"[2]"; //Want to display 3rd item of selected array.
}
//The labels display only the string (language0[0]) NOT array's value.