I have the whole code working but need a little help getting the converted array to display correctly in the wordListBox. Any help would be appreciated. The code I have is listed below and the string[] word is declared in the class level.
private void Convert(string[] wordArray, int count)
{
//Convert numbers
for (int index = 0; index < count; index++)
{
if (numbers[index] == 1)
{
wordArray[index] = "one";
}
else if (numbers[index] == 2)
{
wordArray[index] = "two";
}
else if (numbers[index] == 3)
{
wordArray[index] = "three";
}
else if (numbers[index] == 4)
{
wordArray[index] = "four";
}
else if (numbers[index] == 5)
{
wordArray[index] = "five";
}
else if (numbers[index] < 1)
{
wordArray[index] = "lower";
}
else
{
wordListBox.Items.Add("higher");
}
}
}
private void ConvertButton_Click(object sender, EventArgs e)
{
wordListBox.Items.Clear();
Convert(word, count);
wordListBox.Items.Add(word);
}
