title: Playing a list of songs in combobox one by one in C#
body: <p>I have a list of songs in a combobox. I am playing the song based on the selection if user. Here is my code.</p>
  
  <pre><code>private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
      {
          wplayer.controls.pause();
          song = comboBox1.SelectedItem.ToString();
          index1 = comboBox1.SelectedIndex;
          pictureBox4.Image=Image.FromFile(Application.StartupPath + "\\Input\\zeneszek.gif");
          pictureBox4.SizeMode=PictureBoxSizeMode.StretchImage;
          pictureBox4.Visible=true;
           wplayer.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(wplayer_PlayStateChange);
          wplayer.URL = Application.StartupPath + "\\Input\\" + song + ".mp3";
          wplayer.controls.play();
          WMPLib.WMPPlayState playstate = WMPLib.WMPPlayState.wmppsMediaEnded;
          label4.Text = "Playing" + song;
      }
   public void wplayer_PlayStateChange(int newstate)
          {
              if (newstate == (int)WMPLib.WMPPlayState.wmppsMediaEnded)
              {
                  playstate = WMPLib.WMPPlayState.wmppsMediaEnded;
                  song = comboBox1.Items[index1++].ToString();
  }
  }
  </code></pre>
  
  <p>After the end of the song I wanted to play the next song which is the next one in the combobox selection. Can someone help on this? I tried playstate change event also. Still I am not able to play the next song. I increased the index of the combobox when the play state is wmppsMediaEnded. When do I need to play that song? I tried playing the song when the state is wmppsStopped and wmmppsTransitioning but in both the cases I am able to play only two songs continuously. after the end of the 2nd song I am not able to play the remaining. </p>