tags:

views:

54

answers:

2

Hello all,

I have the following code which plays a video clip but when it is finished it does not release the form but instead leaves the last frame of the video. how do I get it to clear when playback ends so that I can see the orignal contents of the form it took over to play the video?

_video = new Video("video.wmv");
_video.Owner = frmVideoWindow;
_video.Play();
A: 

Release the form you mean to close it? You might want to check for an event in your Video object that will raise when the video is done and you will need to use this.close(); to close the form. Is it what you desire?

Daok
not really - have updated the question but the video playback took over an existing form and I want to be able to get that form back when the video ends
A: 

Daok pointed me in the correct direction. An event handler on the video ending and then setting the Owner of the Video object to null.

_video.Ending += new System.EventHandler(this.video_stopped);

private void video_stopped(object sender, EventArgs e)
{
    _video.Owner = null;
}