Seemingly simple command, trying to show the text "Making noise" whenever an animal in my Zoo program makes a noise. It doesn't seem to use that text though, instead it will run whatever method is selected, but will seemingly stay as "Nothing" in my label. If I get rid of the "Nothing" at the end of the if/elses, it will change to "Making noise" after my methods have run. :/
Also, the MakeNoise() method isn't instantly over; there are System.Threading.Thread.Sleeps in those too, so it's not like it should be too fast for a user to see.
Question
GC_Trojan
Seemingly simple command, trying to show the text "Making noise" whenever an animal in my Zoo program makes a noise. It doesn't seem to use that text though, instead it will run whatever method is selected, but will seemingly stay as "Nothing" in my label. If I get rid of the "Nothing" at the end of the if/elses, it will change to "Making noise" after my methods have run. :/
private void btnNoise_Click(object sender, EventArgs e) { labState.Text = "Making noise"; //System.Threading.Thread.Sleep(500); if ((radCats.Checked) && (radOne.Checked)) { Zoo[0].MakeNoise(); } else if ((radCats.Checked) && (radTwo.Checked)) { Zoo[1].MakeNoise(); } else if ((radDogs.Checked) && (radOne.Checked)) { Zoo[2].MakeNoise(); } else if ((radDogs.Checked) && (radTwo.Checked)) { Zoo[3].MakeNoise(); } else if ((radTigers.Checked) && (radOne.Checked)) { Zoo[4].MakeNoise(); } else { } //System.Threading.Thread.Sleep(500); labState.Text = "Nothing"; }Also, the MakeNoise() method isn't instantly over; there are System.Threading.Thread.Sleeps in those too, so it's not like it should be too fast for a user to see.
Edited by GC_TrojanLink to comment
Share on other sites
8 answers to this question
Recommended Posts