• (2 Pages)
  • +
  • 1
  • 2

How to make a DVD Player for VB.NET Rate Topic: -----

#1 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 22 February 2009 - 11:58 PM

In this Tutorial I,m going to show you how to make a DVD Player in VB.NET.


Step 1: Stetting up the Form

Firstly create a Windows Form Application and Name the new project a name. An Example of a name would be “DVD Player”.

Attached Image





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

Attached Image





When you finish that you would change the size of the form to a size suitable for your screen.

Attached Image






Step 2: Adding things to your Form

Add a Menustrip and put File and Exit in your Menustrip as shown in the diagram below.

Attached Image





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

Attached Image




Now go to tools and click on choose ToolBox Items.

Attached Image





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

Attached Image




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

Attached Image




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.

Attached Image






Now go to MSWebDVD Class Properties and change the name of MSWebDVD to DVD1.

Attached Image





Step 3: Adding the Code

Right Click on Form1 in the Solution Explorer and click "View Code".

Attached Image





Now type this Code Below




This code should come up when you click view code

Public Class Form1




This code is to play your DVD's so double click on your play button and input this 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.


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.


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.

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.


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.

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.

	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.


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

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.

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.

End Class



Attached Image


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 February 2009 - 10:42 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to make a DVD Player for VB.NET

#2 rajaraman.u  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-March 09

Posted 04 March 2009 - 10:55 AM

Could you tell me how to write code for playing a file located on harddisk.

I want to select the file from file->open and search my own music files
Was This Post Helpful? 0
  • +
  • -

#3 cbrickhouse  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 57
  • Joined: 01-March 09

Posted 04 March 2009 - 11:00 AM

View Postrajaraman.u, on 4 Mar, 2009 - 09:55 AM, said:

Could you tell me how to write code for playing a file located on harddisk.

I want to select the file from file->open and search my own music files


modify the code to use an openfiledialog.

something like this

Private fdlg As OpenFileDialog = New OpenFileDialog()
Private fdlg.Title = "C# Corner Open File Dialog"
Private fdlg.InitialDirectory = "c:\"
Private fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"
Private fdlg.FilterIndex = 2
Private fdlg.RestoreDirectory = True
If fdlg.ShowDialog() = DialogResult.OK Then
textBox1.Text = fdlg.FileName
End If


This post has been edited by cbrickhouse: 04 March 2009 - 11:01 AM

Was This Post Helpful? 0
  • +
  • -

#4 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 04 March 2009 - 01:15 PM

View Postrajaraman.u, on 4 Mar, 2009 - 09:55 AM, said:

Could you tell me how to write code for playing a file located on harddisk.

I want to select the file from file->open and search my own music files


Hey rajaraman.u, try something like this

OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.CurrentDirectory

		OpenFileDialog1.ShowDialog()

		DVD1.URL = OpenFileDialog1.FileName



Type the code below in the filter box in the properties of the open file dialog.

Video Files |*.WMV;* .mp4;* .avi

This code will make you play WMV, mp4 and .avi.

This post has been edited by nritzau: 04 March 2009 - 01:16 PM

Was This Post Helpful? 0
  • +
  • -

#5 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 04 March 2009 - 01:31 PM

View Postrajaraman.u, on 4 Mar, 2009 - 09:55 AM, said:

Could you tell me how to write code for playing a file located on harddisk.

I want to select the file from file->open and search my own music files


Sorry about that i miss read it i will give you the code for the music files:

 OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.CurrentDirectory

		OpenFileDialog1.ShowDialog()

		DVD1.URL = OpenFileDialog1.FileName

	End Sub


Type the code below in the filter box in the properties of the open file dialog.

Music Files |*.mp3;* .wma;* .wav

This code will make you play Music Files |*.mp3;* .wma;* .wav
Was This Post Helpful? 0
  • +
  • -

#6 myhaksown  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 07-January 09

Posted 28 March 2009 - 10:11 PM

I Can't find MSWebDVD where do I get it other then the place given?
Was This Post Helpful? 0
  • +
  • -

#7 Magic_Man  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -5
  • View blog
  • Posts: 85
  • Joined: 03-March 09

Posted 04 April 2009 - 06:46 PM

View Postmyhaksown, on 28 Mar, 2009 - 09:11 PM, said:

I Can't find MSWebDVD where do I get it other then the place given?


Try looking for WMPlayer. I had the same problem finding it. It may or may not do the same thing. I'm not sure. I haven't messed around with the WMPlayer control much yet.

This post has been edited by Magic_Man: 04 April 2009 - 06:52 PM

Was This Post Helpful? 0
  • +
  • -

#8 Orpheus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 26-April 09

Posted 07 May 2009 - 05:58 AM

Hey, how do I get volume ? cos I've tried all sorts, and DVD1.volume only accepts 0 as an augment :S
Was This Post Helpful? 0
  • +
  • -

#9 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 10 May 2009 - 05:32 AM

View PostOrpheus, on 7 May, 2009 - 04:58 AM, said:

Hey, how do I get volume ? cos I've tried all sorts, and DVD1.volume only accepts 0 as an augment :S


Hey Orpheus, Go to this website it should help your dvd volume problem http://msdn.microsof...103(VS.85).aspx

This post has been edited by nritzau: 10 May 2009 - 05:34 AM

Was This Post Helpful? 0
  • +
  • -

#10 Orpheus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 26-April 09

Posted 10 May 2009 - 09:28 AM

hum, I did try but it seems to have failed, I think it might be because i'm on vista?
Was This Post Helpful? 0
  • +
  • -

#11 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 13 May 2009 - 02:23 PM

View PostOrpheus, on 10 May, 2009 - 08:28 AM, said:

hum, I did try but it seems to have failed, I think it might be because i'm on vista?


It could be i use to be on XP and it worked fine but now with vista i can't even find MSWebDVD Class.
Was This Post Helpful? 0
  • +
  • -

#12 nritzau  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 66
  • Joined: 31-January 09

Posted 13 May 2009 - 02:29 PM

View PostOrpheus, on 10 May, 2009 - 08:28 AM, said:

hum, I did try but it seems to have failed, I think it might be because i'm on vista?

Are you using MSWebDVD Class?
Was This Post Helpful? 0
  • +
  • -

#13 Orpheus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 26-April 09

Posted 13 May 2009 - 02:39 PM

Yeah I am, I downloaded it from the Microsoft repository so it's the latest version too. . . not quite sure why I can't get the volume to work on it, the link you provided on the 10th was contradictory as it said 0 was both silent and full volume :S

I also have some DVD players installed, so it might be one of them?
Was This Post Helpful? 0
  • +
  • -

#14 palalooya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-August 09

Posted 24 August 2009 - 08:58 PM

View PostOrpheus, on 13 May, 2009 - 01:39 PM, said:

Yeah I am, I downloaded it from the Microsoft repository so it's the latest version too. . . not quite sure why I can't get the volume to work on it, the link you provided on the 10th was contradictory as it said 0 was both silent and full volume :S

I also have some DVD players installed, so it might be one of them?



Click Here to download

download file above and dump the file in in System 32folder

then you will have the MSWebDVD.dll

This post has been edited by palalooya: 24 August 2009 - 08:59 PM

Was This Post Helpful? 0
  • +
  • -

#15 crzyone9584  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 201
  • Joined: 22-April 08

Posted 15 September 2009 - 09:26 PM

OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.CurrentDirectory

		OpenFileDialog1.ShowDialog()

		DVD1.URL = OpenFileDialog1.FileName

	End Sub


that Doesn't work. the .url is not part of the webdvd player.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2