Goal: I want to grab 2 strings from an array at random and then put them together.
Problem: When I click button1, textbox1 shows one of the colors back-to-back
(BlackBlack, BlueBlue, BrownBrown, GrayGray, GreenGreen) ☒
instead of showing 2 different colors back-to-back.
(BlackBlue, BlueBrown, BrownGray, GrayGreen, GreenOrange) ☑
This is my code (so far):
string[] Colors = { "Black", "Blue", "Brown", "Gray", "Green", "Orange", "Pink", "Purple", "Red", "White", "Yellow" };
private void button1_Click(object sender, EventArgs e)
{
string FirstColor;
string SecondColor;
FirstColor = Colors[new Random().Next(0, Colors.Length)];
SecondColor = Colors[new Random().Next(0, Colors.Length)];
textBox1.Text = FirstColor + SecondColor;
}