Gary1959
New member
Hi
I want to load a movie and play it in a mediaplayer control on a form. Below is the code I used to do this in VB 6. It does not seem to work in VB.NET. Does it take much to recode for VB.NET. This is part of a program I made, when I was learning VB 6, about the solar system which I cannot open so I am going to recode and undate it in VB.NET.
Gary
I want to load a movie and play it in a mediaplayer control on a form. Below is the code I used to do this in VB 6. It does not seem to work in VB.NET. Does it take much to recode for VB.NET. This is part of a program I made, when I was learning VB 6, about the solar system which I cannot open so I am going to recode and undate it in VB.NET.
VB.NET:
Private Sub cmdOpen_Click()
Me.MediaPlayer1.AutoSize = False
Me.MediaPlayer1.AutoStart = False
Me.MediaPlayer1.VideoBorder3D = False
Me.MediaPlayer1.Left = -5000
Me.MediaPlayer1.DisplaySize = mpFitToSize
Me.MediaPlayer1.FileName = "h:\cbt\Library\Samples\Sample.mpg"
Do Until Me.MediaPlayer1.ReadyState = mpReadyStateInteractive
DoEvents
Loop
Me.MediaPlayer1.Left = 0
End Sub
Private Sub cmdPlay_Click()
If Me.MediaPlayer1.Left = 0 Then
If Me.MediaPlayer1.PlayState = mpStopped Then
Me.MediaPlayer1.DisplaySize = mpFitToSize
Me.MediaPlayer1.Play
End If
End If
End Sub
Gary