I'm writing C# app in Visual Studio that plays video using DirectShow (Quartz.dll). One problem I'm having is getting the video back to the beginning when the user clicks the stop button to stop video playback. The other problem is clearing out the last frame of the video from the picturbox control.

Here's the code at the top related to the QuartzTypeLib:

```
public partial class frmMain : Form
{
    public const int WS_CHILD = 0x40000000;
    public const int WS_CLIPCHILDREN = 0x2000000;
    public QuartzTypeLib.IMediaControl mc;
    public QuartzTypeLib.IVideoWindow videoWindow = null;

```

Here's the code for opening a file, including code to create an instance of the FileGraphManager:

```
    private void openMediaToolStripMenuItem_Click(object sender, EventArgs e)
    {
        // Open a media file.
        OpenFileDialog ofd = new OpenFileDialog();
        ofd.Filter = "Video Files|*.mpg;*.avi;*;*.wmv;*.mov|Audio Files|*.mp3;*.wav;*.wma";
        ofd.FilterIndex = 1;
        if (DialogResult.OK == ofd.ShowDialog())
        { 
            // Stop the playback for the current video if one is currently playing.
            if (mc != null)
                mc.Stop();
            if (pbVideoDisplay.Image != null)
                pbVideoDisplay.Image = null;
            // Load the movie file.
            FilgraphManager graphManager = new FilgraphManager();
            graphManager.RenderFile(ofd.FileName);
            mc = (IMediaControl)graphManager;

            // Send the video to the picture box control pbVideoDisplay) on frmMain.
            try
            {
                videoWindow = (IVideoWindow)graphManager;
                videoWindow.Owner = (int)pbVideoDisplay.Handle;
                videoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
                videoWindow.SetWindowPosition(
                pbVideoDisplay.ClientRectangle.Left,
                pbVideoDisplay.ClientRectangle.Top,
                pbVideoDisplay.ClientRectangle.Width,
                pbVideoDisplay.ClientRectangle.Height);
            }
            catch
            {

            }
        }
    }

```

Here's the code for closing the media:

```
    private void closeMediaToolStripMenuItem_Click(object sender, EventArgs e)
    {
        mc.Stop();
    }

```

And here's the code for stopping video playback:

```
    private void tsbtnStop_Click(object sender, EventArgs e)
    {
        mc.Stop();
    }

```

mc.Stop() will stop the video at video's current location, just like the mc.Pause() function does. How can I reset the video position to the beginning of the video when mc.Stop() is called? And how can I clear that last video frame out of the picturebox control? I tried "pbVideoDisplay.Image = null;" but the last video frame persists. Obviously I need more code to close the video, but I can't find any samples anywhere.