Help! Windows Media Component???

pv1328

New member
Joined
May 10, 2010
Messages
1
Programming Experience
Beginner
Ok, so here it is: I want a video to play when the form is loaded. Once it is done playing, i want to hide the form, and open another form.

I am using Microsoft Visual Basic 2008 Express Edition

my code is:

VB.NET:
Public Class frmSplashVideo

    Private Sub frmSplashVideo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim splashPath As String = Application.StartupPath
        wmpSplash.URL = splashPath & "\resources\splash.wmv"

    End Sub

    Private Sub wmpSplash_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles wmpSplash.PlayStateChange

        Select Case wmpSplash.playState
            Case 0
                MsgBox("0")
            Case 1
                MsgBox("1")
            Case 2
                MsgBox("2")
            Case 3
                MsgBox("3")
            Case 4
                MsgBox("4")
            Case 5
                MsgBox("5")
            Case 6
                MsgBox("6")
            Case 7
                MsgBox("7")f
            Case 8
                MsgBox("8")
        End Select

        'If wmpSplash.playState = WMPLib.WMPPlayState.wmppsMediaEnded Then
        '    MsgBox("")
        'End If
    End Sub
End Class

I tried this on a Windows XP machine that had windows media player 10 and it worked fine. I tried on a Windows XP machine that had windows media player 11, and it did not work..

Any ideas?

thanks
 
Back
Top