Media Player Query

In a VB.NET I am using a code

Public WithEvents MediaPlayer As AxWMPLib.AxWindowsMediaPlayer

… … …
… … …
… … …

And I use a code like :
MediaPlayer.uiMode = “none”

In some project it runs fine.
But here it throws an exception :
[Exception of type ‘System.Windows.Forms.AxHost+InvalidActiveXStateException’ was thrown.]

Can anyone help to solve the problem ?


Hey, can you throw some code our way, so you can get some help. It is hard to help, if we haven’t seen the code.


I did not add the “MediaPlayer” control properly.

Now it is okay.