当picturebox在button1上时,它会向label2添加10个点 [英] making that when picturebox is on button1 it will add 10 points to label2

查看:56
本文介绍了当picturebox在button1上时,它会向label2添加10个点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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..

推荐答案

请你解释一下这个问题,以便我协助

hi could you kindly explain the problem so i may assist


这篇关于当picturebox在button1上时,它会向label2添加10个点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆