How To: Create A Media Player In Visual Basic 6

Saturday, April 18, 2009

Hello! In this tutorial, you will learn how to create your own media player in Visual Basic 6. Visual Basic 6 is one of the most simplest programming software. There are many new versions of Visual Basic, but version 6 is one of the most popular ones people like. Other programming languages you may have heard of are, C+, C++, C#, Java, etc. Those ones are much more complicated than Visual Basic 6. Anyways, open up Visual Basic 6. When you execute the program, it will ask you what kind of program you want to create. Simply click Standard Exe for this How-To. A blank window will be created with the default properties, the label will say "Form 1". You can resize the form by dragging the corners out if you want to. Next, right click the toolbar on the left side of the program. Click the Components... button. It will open a window with a lot of different components you can add and remove. Click the Controls tab at the top and scroll all the way down until you see, "Windows Media Player". Tick off the box beside it and click Apply then click Close. Click the new button that has appeared. Now, within the Form 1 window, create a Windows Media Player screen. You can remove the video screen of the Windows Media Player if you want to, you don't have to though. Click the text box button and create a text box. Then, click the command button and drag and create a command button in the form 1 screen. The textbox is where the directory of the media file will be. For example, C:/Desktop/mp3.mp3, would be a directory. The command button will be used to tell the program to find the file and then output the file's contents into the windows media player widget. So, double click the command button you've created to open up it's code properties. Click between the code that is already there and type, "WindowsMediaPlayer1.URL = Text1.Text". Type it without the quotations of course. If you do not want the Text Box to say text1 inside of it by default, click on the Textbox to bring up its properties in the bottom right part of the screen. Now, look for where it says Text. It should have text1 by default inside of the box. Click the box and change it you whatever you want, leave it blank if you want to. That's it! Simply hit the "Start" button at the top of the screen to run it. To get a media file's directory, right click it. Where it says Location, select and copy the text beside of it and paste it into the program's textbox. Do not forget to put in another \ slash and then type the name of the media file with extension. It should be Example.mp3 or Example.AVI. This is a rather simple program and looks OK for a beginner user in VB6. Thanks for reading!

0 comments:

Post a Comment

Post a Comment

About This Blog

This blog is about stuff related to programming, math, physics and some other fun stuff.


  © Blogger template On The Road by Ourblogtemplates.com 2009

Back to TOP