我知道这可能是非常基本的,我用谷歌搜索并完成了搜索,但我遇到的问题是一个非常基本的if/else场景.第一个语句产生结果,这告诉我,我以某种方式弄乱了其他语句.这让我有点疯狂.仅供参考,这是我第一次使用表单窗口.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Wk2_Part1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int season;
int job;
season = Convert.ToInt32(textBox1.Text);
job = Convert.ToInt32(textBox2.Text);
if (season == 1)
if (job == 1)
label3.Text = "There is a 20% discount on the exterior job";
else
if (season == 2)
if (job == 1)
label3.Text …Run Code Online (Sandbox Code Playgroud)