I am trying to figure out how to close my application when the video that the form plays stops playing. Currently, the user clicks a button to bring up Form2. The control for the video is set to force the video full screen, and start playing from the beginning of the video. I am using axWindowsMediaPlayer to provide the video. I am also a complete neophyte when it comes to C#.
How would I get my application to close when the video stops playing?
You need to detect when the media has ended, here is a tutorial on: “Detect the End of Media – axWindowsMediaPlayer”. Then you need to call
Close();to close the form you are currently playing the media from.Example (snippets from msdn):
Then you need the event handler that can look like this: