---
title: "when video ends, close the active form"  
description: "when video ends, close the active form"  
author: "Anonymous User"  
published: 2013-12-09  
updated: 2013-12-10  
canonical: https://www.mindstick.com/forum/1759/when-video-ends-close-the-active-form  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# when video ends, close the active form

I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to [close](https://yourviews.mindstick.com/story/1687/rubbing-hands-close-up-benefits) a [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) in which a [video](https://www.mindstick.com/articles/290133/6-necessary-preparations-you-need-before-editing-a-video) is playing. I want it to close said form when the video ends.

I'm using wmp [embedded](https://www.mindstick.com/articles/332094/what-is-embedded-software-engineering) into my form, with ui [mode](https://yourviews.mindstick.com/view/81372/us-congress-should-go-in-remote-mode-for-proper-functioning) hidden.

Thanks

## Replies

### Reply by Anonymous User

Hi Jeet,\

You can subscribe to the PlayStateChange event of the player.

```
wmp.PlayStateChange += new
AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(wmp_PlayStateChange);private void wmp_PlayStateChange(object sender,
AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e){    if(e.newState ==
8)       this.Close();}
```


---

Original Source: https://www.mindstick.com/forum/1759/when-video-ends-close-the-active-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
