I have an array:
class Words
{
public static string[] wordsArray = { "one", "two", "three", "four" };
}
TextBlock which displays an array of values, and button that displays the next value of the array:
private int counter = 0;
private void goButton_Click(object sender, RoutedEventArgs e)
{
if (counter < Words.wordsArray.Length)
{
enWordTextBlock.Text = Words.wordsArray[counter++];
}
}
When the box appears on the last value of the array, the program will continue to not work, how to make it work in a “circle”?
Thanks all!
This should work: