C#为图片框添加值
本文关键字:添加 | 更新日期: 2023-09-27 18:26:28
我最近刚刚发布了一些关于我正在Microsoft visual C#express中进行的C#游戏项目的消息,经过反复尝试,我在下面提供的代码将无法工作。有人能给我什么建议或帮助吗?代码中带有括号、星号和箭头的部分是不适用于我的错误。(注意:我正在Microsoft Visual C#express上制作一个表单。)
if (buttonFlag[0])
{
return;
}
if (accept)
{
return;
}
textBox2.Text = "";
textBox1.Text = "";
offerCounter++;
---> [[[ **pictureBox2.Image**]]]<--- = tempLabel = buttonList[0].ToString();
LostValues(tempLabel);
textBox1.Text = "-> you just opend " + tempLabel + "'n";
CallZero(tempLabel);
if (offerCounter == 20)
{
finalValue = GetFinalValue();
MessageBox.Show("You win " + finalValue.ToString());
textBox1.Text = "Game is over" + "'n";
textBox1.Text += "you won: " + finalValue.ToString();
label16.Content = "you won:";
label17.Content = finalValue.ToString();
label18.Text = "Game Over";
accept = true;
}
if (offerCounter <= 18)
{
if ((offerCounter % 3) == 0)
{
GenerateNewOffer();
textBox1.Text += "-> you have a new offer ";
MessageBox.Show("you recieved a new offer !");
textBox2.Text = newOffer.ToString();
}
else
{
offerRemainder = 3 - (offerCounter % 3);
textBox1.Text += "-> Open " + offerRemainder.ToString() + "more box(es) for new offer";
}
}
else
{
textBox2.Text = "";
}
PictureBox.Image属性获取一个Image实例。请阅读MSDN以了解两者,并相应地编写代码。