问题描述
private void Question_Click(object sender, EventArgs e)
{
string message = "You want to answer this question?";
string caption = "Question";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
result = MessageBox.Show(message, caption, buttons);
DialogResult dialogResult = MessageBox.Show("Did Lot told the angels that the city is going to destroy or they did?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == System.Windows.Forms.DialogResult.Yes && pictureBox1.Location == Question.Location)
{
int number = Convert.ToInt32(label4.Text);
number = number + 15;
label4.Text = number.ToString();
MessageBox.Show("Correct! You won 15 points");
}
if (result == System.Windows.Forms.DialogResult.Yes && pictureBox2.Location == Question.Location)
{
int number1 = Convert.ToInt32(label3.Text);
number1 = number1 + 15;
label3.Text = number1.ToString();
MessageBox.Show("Correct! You won 15 points");
}
}
我不知道为什么它会跳过if ..
i dont know why its skipping the if..
推荐答案
这篇关于当picturebox在button1上时,它会向label2添加10个点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!