In this Tutorial I,m going to show you how to make a DVD Player in VB.NET.
Step 1: Stetting up the FormFirstly create a Windows Form Application and Name the new project a name. An Example of a name would be “DVD Player”.

Now we would go to the properties of the form and change the text to DVD Player.

When you finish that you would change the size of the form to a size suitable for your screen.
Step 2: Adding things to your FormAdd a Menustrip and put File and Exit in your Menustrip as shown in the diagram below.

Now add more text in the menustrip as shown in the diagram below.

Now go to tools and click on choose ToolBox Items.

Click on the COM Components and scroll down until you find MSWebDVD Class, tick MSWebDVD and press OK.

Now click on MSWebDVD Class from the toolbox and add 1 MSWebDVD Class to your DVD Player.

Go over to the Forms Properties and scroll down to you find Dock and Change the Dock to Fill. This should make the size of MSWebDVD Class change to the full size of the DVD Player.

Now go to MSWebDVD Class Properties and change the name of MSWebDVD to DVD1.
Step 3: Adding the CodeRight Click on Form1 in the Solution Explorer and click "View Code".

Now type this Code Below
This code should come up when you click view code
CODE
Public Class Form1
This code is to play your DVD's so double click on your play button and input this code.
CODE
Private Sub PlayToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdplay.Click
DVD1.Play()
End Sub
This code is to pause your DVD's so double click on your pause button and input this code.
CODE
Private Sub PauseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdpause.Click
DVD1.Pause()
End Sub
This code is to Stop your DVD's so double click on your Stop button and input this code.
CODE
Private Sub StopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdstop.Click
DVD1.Stop()
End Sub
This code is to Rewind your DVD's so double click on your Rewind button and input this code.
CODE
Private Sub BackwardsX2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdbackwards.Click
DVD1.PlayBackwards(2)
End Sub
This code is to Fast Forward your DVD's so double click on your Fast Forward button and input this code.
CODE
Private Sub FastForwardToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdforward.Click
DVD1.PlayForwards(2)
End Sub
This code is for Previous Chapter on your DVD Player so double click on your Previous Chapter button and input this code.
CODE
Private Sub PreviousChapterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdchapminus.Click
DVD1.PlayPrevChapter()
End Sub
This code is Next Chapter for DVD Player so double click on your pause button and input this code.
CODE
Private Sub NextChapterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NextChapterToolStripMenuItem.Click
DVD1.PlayNextChapter()
End Sub
This code is to exit your DVD Player so double click on your exit button and input this code.
CODE
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
This code is to input a msgbox in your DVD player to tell you that you have to insert a dvd into the disc drive
CODE
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("Please insert a disk into drive D: or E:, Than press OK")
End Sub
This code is to view full screen on your DVD Player.
CODE
Private Sub FullScreenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FullScreenToolStripMenuItem.Click
DVD1.FullScreenMode() = True
End Sub
This code is to your code this goes after you input all your codes it should be there already.
CODE
End Class

I hope you have enjoyed my tutorial and I hope you know now How to make a DVD Player.
If you have any problems please post in this forum and I can fix up the problems.
This post has been edited by nritzau: 24 Feb, 2009 - 09:42 PM