I would like for the messagebox.show to say ("Sorry - You Lose, The number is","label1.Text"); but where it says label.text I want it to say the number that was generated.
private void button1_Click(object sender, EventArgs e)
{
RandomNumber(0,99);
button2.Enabled = true ;
button1.Enabled = false;
if (textBox1.Text == label1.Text)
MessageBox.Show("Winner");
if (textBox1.Text != label1.Text)
MessageBox.Show("Sorry - You Lose, The number is{0}",label1.Text);
}
MessageBox.Show("Sorry - You Lose, The number is " + label1.Text);
MessageBox.Show(string.Format("Sorry - You Lose, The number is {0}",label1.Text));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With