private void btnCheckitTCor_Click(object sender, EventArgs e) { guessTCor = tbLetterTCor.Text; string woordbcTCor = tbGuessTCor.Text; if (tbLetterTCor.Text.Trim() == "") { MessageBox.Show("Niet ingevuld"); } else { tbGuessTCor.Text = tbGuessTCor.Text = FindCharAndReturnCorrectedString(tbCorrectwordTCor.Text, guessTCor, tbGuessTCor.Text); if (woordbcTCor == tbGuessTCor.Text) { mciSendString("close Mediafile", null, 0, IntPtr.Zero); string m_location; m_location = Application.StartupPath; m_location = m_location + "\\..\\..\\snd\\boo.mp3"; mciSendString("open \"" + m_location + "\" type mpegvideo alias Mediafile", null, 0, IntPtr.Zero); mciSendString("play Mediafile", null, 0, IntPtr.Zero); NrOfAttemptsTCor--; wrongTCor++; if (NrOfAttemptsTCor == 0) { mciSendString("close Mediafile", null, 0, IntPtr.Zero); string m_location2; m_location2 = Application.StartupPath; m_location2 = m_location + "\\..\\..\\snd\\aww.mp3"; mciSendString("open \"" + m_location + "\" type mpegvideo alias Mediafile", null, 0, IntPtr.Zero); mciSendString("play Mediafile", null, 0, IntPtr.Zero); this.Controls.Clear(); MessageBox.Show("You lost, but look look at this panda!! :-)"); } } else { } if (tbGuessTCor.Text == tbCorrectwordTCor.Text) { string m_location; m_location = Application.StartupPath; m_location = m_location + "\\..\\..\\snd\\applause.mp3"; mciSendString("open \"" + m_location + "\" type mpegvideo alias Mediafile", null, 0, IntPtr.Zero); mciSendString("play Mediafile", null, 0, IntPtr.Zero); this.Controls.Clear(); this.InitializeComponent(); MessageBox.Show("Gefeliciteerd! U heeft gewonnen!"); } lblWrongTCor.Text = Convert.ToString(wrongTCor); lblLeftTCor.Text = Convert.ToString(NrOfAttemptsTCor); pbAttemptsTCor.Value = NrOfAttemptsTCor; } }