Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Imports System.IO
Imports AxWindowsMediaPlayer1 = AxWMPLib


Public Class Csv
    Dim ResourceFilePath As String


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        SelectPageList.Show()
        Me.Close()

    End Sub

    Private Sub AxWindowsMediaPlayer1_Enter(sender As Object, e As EventArgs) Handles AxWindowsMediaPlayer1.Enter
        ' Determine the Resource File Path
        If System.Diagnostics.Debugger.IsAttached() Then
            'Debugging mode
            ResourceFilePath = System.IO.Path.GetFullPath(Application.StartupPath & "\..\..\resources\")
        Else
            'Published mode
            ResourceFilePath = Application.StartupPath & "\resources\"
        End If

        ' Specify the avi file
        AxWindowsMediaPlayer1.URL = ResourceFilePath & "\\csv.avi"
        ' Media Player automatically plays file by default

    End Sub

    Private Sub Csv_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class


What I have tried:

when i first run the application the video played without any problem, the next time i opened the application the video wont play again, and i dont know why
Posted
Updated 27-Mar-18 9:53am

1 solution

You have to use a variable, for example: firstRun. You can store it somewhere: resources, file, etc.

Here is an idea:
Save and restore your form size and location[^]
Where should I store my data?[^]
 
Share this answer
 
Comments
Member 13341316 28-Mar-18 15:37pm    
i dont really understand those links, and the codes in those links are not vb.net codes. please help me out
Maciej Los 28-Mar-18 15:52pm    
What part you don't understand? The most importanst is:
You have to use a variable, for example: firstRun. You can store it somewhere: resources, file, etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900