こんにちは、私のクイズで次の質問に変更するのに問題があります。
private void Form1_Load(object sender, EventArgs e)
{
Random random = new Random();
int Month = random.Next(0);
if (Month == 0)
{
radioButton1.Text = "January";
radioButton2.Text = "April";
radioButton3.Text = "August";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\1. Enero – January.Wav");
simpleSound.Play();
}
if (Month == 1)
{
radioButton1.Text = "July";
radioButton2.Text = "December";
radioButton3.Text = "February";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\2. Febero – February.Wav");
simpleSound.Play();
}
if (Month == 2)
{
radioButton1.Text = "May";
radioButton2.Text = "September";
radioButton3.Text = "March";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\3. Marzo – March.Wav");
simpleSound.Play();
}
if (Month == 3)
{
radioButton1.Text = "April";
radioButton2.Text = "August";
radioButton3.Text = "March";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\4. Abril – April.Wav");
simpleSound.Play();
}
if (Month == 4)
{
radioButton1.Text = "March";
radioButton2.Text = "May";
radioButton3.Text = "November";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\5. Mayo – May.Wav");
simpleSound.Play();
}
if (Month == 5)
{
radioButton1.Text = "July";
radioButton2.Text = "June";
radioButton3.Text = "February";
SoundPlayer simpleSound = new SoundPlayer(@"C:\Users\Callum\Documents\My Projects (Dissertation)\App sounds and pictures\Unit 8 Months (Complete)\Audio\6. Junio – June.Wav");
simpleSound.Play();
}
static int i = 0;
private void button1_Click(object sender, EventArgs e)
{
Random random = new Random();
int Month = random.Next(0);
if (Month == 0)
if (radioButton1.Checked)
{
label1.Text = "Correct";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
if (Month == 1)
if (radioButton1.Checked)
{
label1.Text = "Incorrect";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Correct";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
if (Month == 2)
if (radioButton1.Checked)
{
label1.Text = "Incorrect";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Correct";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
if (Month == 3)
if (radioButton1.Checked)
{
label1.Text = "Correct";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
if (Month == 4)
if (radioButton1.Checked)
{
label1.Text = "Incorrect";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Correct";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
if (Month == 5)
if (radioButton1.Checked)
{
label1.Text = "Incorrect";
radioButton2.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton2.Checked)
{
label1.Text = "Correct";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
else if (radioButton3.Checked)
{
label1.Text = "Incorrect";
radioButton1.Enabled = false;
radioButton3.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
radioButton1.text = Month[i];
radioButton2.text = Month[i];
radioButton3.text= Month[i];
i = (i + 1) % 5;
}
3 つのエラーが発生します。 using ディレクティブまたはアセンブリ参照がありません)
私はこれが初めてで、自分自身にc#を教えようとしているので、しばらくお待ちください。よろしくお願いします。