c# 怎样退出if (textBox1.Text == "1")?
如:privatevoidbutton1_Click(objectsender,EventArgse){if(textBox1.Text=="1"){for(inti=0...
如:
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "1")
{
for (int i = 0; i < 5; i++)
{
if (i == 2)
label1.Text = "2";
if (i == 3)
break;//这里应该怎样写?
if (i == 4)
label1.Text = "4";
}
label1.Text = "5";
}
}
结果是5,怎么才能输入1得到2呢 展开
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "1")
{
for (int i = 0; i < 5; i++)
{
if (i == 2)
label1.Text = "2";
if (i == 3)
break;//这里应该怎样写?
if (i == 4)
label1.Text = "4";
}
label1.Text = "5";
}
}
结果是5,怎么才能输入1得到2呢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询