Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

C# question with if statements

$
0
0
im making a quiz game and the first question is and these are just examples what color is grass and my code for if button is clicked is private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "green") { label1.Text = "What is the color of the sky"; } { if (textBox1.Text == "blue") { label1.Text = "What is the color of a Rose"; } } how do i make it where it only accepts green and not go to next question when i type blue

Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>