Hi, I will make some suggested changes as a couple of things in your code are not right:
if (axWindowsMediaPlayer2.playState.ToString() != "MediaEnded")
Why are you trying to convert the playstate property to a string? If you want to know what the play state is, you should use the correct methods provided for that event. Like so:
PlayStateChangeEvent
if (axWindowsMediaPlayer2.playState == WMPLib.WMPPlayState.wmppsStopped)<br />
{<br />
winmediaplayerstart();<br />
}
I also don't see where ' folderpesni ' Is defined, so expect an exception on that line. And why are you using the .URL property for a non related url file?
Regarding your playstate and other methods you are trying to use above; are all incorrect.
About the referencing issue on Error 3, I can only conclude you have corrupted your code somewhere; perhaps in your designer.cs file. Try to clean your solution and build it again. (If that does not work, remove the component and re-add it by dragging it to your form.) You may also have to replace the handlers which it may remove in code too.
I would also strongly recommend you to read the documentation on this component before going any further.
Documentation.
If you have any questions, please let me know.