arrays - c# change to next page on quiz -
hello im having problem changing next question on quiz.
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 , 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 , 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 , 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 , 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 , 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 , pictures\unit 8 months (complete)\audio\6. junio – june.wav"); simplesound.play(); } static int = 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 + 1) % 5; }
3 errors come saying "'system.windows.form.radiobutton' not contain definition 'text' , no extension method 'text' accepting first arguement type ' system.windows.forms.radiobutton' found (are missing using directive or assembly refference)
im new , trying teach myself c# please patient me, in advance.
c# case-sensitive. property looking text, not text.
private void button2_click(object sender, eventargs e) { radiobutton1.text = month[i]; radiobutton2.text = month[i]; radiobutton3.text= month[i]; = (i + 1) % 5; }
c# arrays visual-studio-2010
No comments:
Post a Comment