我想爲messagebox.show說(「對不起 - 你輸了,數字是」,「label1.Text」);但它說label.text我希望它說生成的數字。如何顯示包含一些標籤內容的MessageBox消息?
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);
}