总结

一、排球计分程序界面

二、代码

private void btn1_Click(object sender, EventArgs e)
{
if (cmbteam.Text == "中国队VS日本队" && cmbci.Text == "第1场")
{
txtA.Text = "25";
txtB.Text = "22";
}
if (cmbteam.Text == "中国队VS日本队" && cmbci.Text == "第2场")
{
txtA.Text = "21";
txtB.Text = "25";
}
if (cmbteam.Text == "中国队VS日本队" && cmbci.Text == "第3场")
{
txtA.Text = "27";
txtB.Text = "25";
}
if (cmbteam.Text == "中国队VS日本队" && cmbci.Text == "第4场")
{
txtA.Text = "25";
txtB.Text = "20";
}

if (cmbteam.Text == "美国队VS法国队" && cmbci.Text == "第1场")
{
txtA.Text = "25";
txtB.Text = "20";
}
if (cmbteam.Text == "美国队VS法国队" && cmbci.Text == "第2场")
{
txtA.Text = "25";
txtB.Text = "18";
}
if (cmbteam.Text == "美国队VS法国队" && cmbci.Text == "第3场")
{
txtA.Text = "25";
txtB.Text = "21";
}
if (cmbteam.Text == "英国队VS俄国队" && cmbci.Text == "第1场")
{
txtA.Text = "25";
txtB.Text = "22";
}
if (cmbteam.Text == "英国队VS俄国队" && cmbci.Text == "第2场")
{
txtA.Text = "21";
txtB.Text = "25";
}
if (cmbteam.Text == "英国队VS俄国队" && cmbci.Text == "第3场")
{
txtA.Text = "27";
txtB.Text = "25";
}
if (cmbteam.Text == "英国队VS俄国队" && cmbci.Text == "第4场")
{
txtA.Text = "23";
txtB.Text = "25";
}
if (cmbteam.Text == "英国队VS俄国队" && cmbci.Text == "第5场")
{
txtA.Text = "15";
txtB.Text = "12";
}
if (cmbteam.Text == "韩国队VS德国队" && cmbci.Text == "第1场")
{
txtA.Text = "25";
txtB.Text = "22";
}
if (cmbteam.Text == "韩国队VS德国队" && cmbci.Text == "第2场")
{
txtA.Text = "21";
txtB.Text = "25";
}
if (cmbteam.Text == "韩国队VS德国队" && cmbci.Text == "第3场")
{
txtA.Text = "27";
txtB.Text = "25";
}
if (cmbteam.Text == "韩国队VS德国队" && cmbci.Text == "第4场")
{
txtA.Text = "23";
txtB.Text = "25";
}
if (cmbteam.Text == "韩国队VS德国队" && cmbci.Text == "第5场")
{
txtA.Text = "15";
txtB.Text = "12";
}
if (cmbteam.Text == "泰国队VS新加坡队" && cmbci.Text == "第1场")
{
txtA.Text = "25";
txtB.Text = "22";
}
if (cmbteam.Text == "泰国队VS新加坡队" && cmbci.Text == "第2场")
{
txtA.Text = "25";
txtB.Text = "17";
}
if (cmbteam.Text == "泰国队VS新加坡队" && cmbci.Text == "第3场")
{
txtA.Text = "19";
txtB.Text = "25";
}
if (cmbteam.Text == "泰国队VS新加坡队" && cmbci.Text == "第4场")
{
txtA.Text = "20";
txtB.Text = "25";
}
if (cmbteam.Text == "泰国队VS新加坡队" && cmbci.Text == "第5场")
{
txtA.Text = "10";
txtB.Text = "15";
}
}

private void btn2_Click(object sender, EventArgs e)
{
if (cmbteam.Text == "中国队VS日本队")
{
txt1.Text = "3";
txt2.Text = "1";
}
if (cmbteam.Text == "美国队VS法国队")
{
txt1.Text = "3";
txt2.Text = "0";
}
if (cmbteam.Text == "英国队VS俄国队")
{
txt1.Text = "3";
txt2.Text = "2";
}
if (cmbteam.Text == "韩国队VS德国队")
{
txt1.Text = "3";
txt2.Text = "2";
}
if (cmbteam.Text == "泰国队VS新加坡队")
{
txt1.Text = "2";
txt2.Text = "3";
}
}

三、运行截图

四、总结

   代码只能实现查询功能,代码不够简练,需要多加学习。

原文地址:https://www.cnblogs.com/chuyanan1996/p/6220175.html