Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Windows Media Player in a Form

Status
Not open for further replies.

mushin

Programmer
Oct 4, 2000
49
I'm trying to implement windows media player in a vb window
using the following code:

'Player = AxWMPlib.AxWindowsMediaPlayer

OpenFileDialog1.ShowDialog()
Player.openPlayer(OpenFileDialog1.FileName)

It works fine except it actually opens the WMP outside my application and not in the wmp component on my window.

Any way of getting this to behave properly, i.e. opening
inside my window within the component and not just instantiating the WMP itself ???

(vb.net 2003)

Thanks,

Kim Allbritain
 
Question did you add the "com component" to your toolbar and then drag it to the windows form? This should allow you to play the music using the media control you dropped on to the form.

 
its a control so you should add it to the controls collection and then do play. I have the code at home. and will see what I can do tommorrow.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Mkohl,

Yes I added the the WMP to my tools, selected it and dropped it on my window.

Seems pretty straightforward to me. I have done the same with other controls (third party stuff, activex), with no problems.

Christiaan,
I took this code from one of DEITEL's books on vb.net development, modified it a bit and used it in my application.

Unfortunately, his original example behaves the same way.

Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top