Code for media player in vb




















Basically the Windows Media Player does not exist in the components portion of the toolbox. So to add the Windows Media Player we need to add it in the toolbox. The first step would be, go to the toolbox and Right click then select Choose Items and the Customize Toolbox dialog box will open.

Then click ok. After this step the Windows Media Player control will appear on the current tab. And for the View submenu is only Playlist Editor. This should look like as shown below. And the final design looks like as shown below. Clear ' clear all currect content of the list. Hide ' it will hide the on the main form. Public Class mainFrm. To add the Windows Media Player control to the toolbox, first select Components from the Project menu. In the Components dialog box, select the check box next to "Windows Media Player".

At the bottom of the dialog box, confirm that the selected file is wmp. After closing the dialog box, you can place an instance of the Windows Media Player control on your form in the usual ways. You can set many control properties using the Properties window. To set some properties you must use the Windows Media Player Properties dialog box, which you open using the " Custom " item in the Properties window. You use certain Player control properties to get references to particular objects.

For example, the cdromCollection property returns a reference to a CdromCollection object. You must assign such a reference to a variable that you declared as the corresponding interface. In those cases, you must declare an object variable as the highest-numbered interface documented in this SDK to have access to all of the properties and methods of that object.

You do not need to declare separate variables for any of these interfaces. This section describes how to create an application that plays video and has custom play and stop buttons. Add the Windows Media Player control to a form.

Resize the control, and then place it where you want the video window to appear. Select the Windows Media Player control, then change the uiMode property to "none". This setting hides the UI controls. When the user plays a video, it will appear in the window. For audio-only content, a visualization will appear.

Now add two buttons to the form. Select the first button and change the Text property to "Play". Select the second button and change its Text property to "Stop". Double-click the Play button to reveal the Code window.



0コメント

  • 1000 / 1000