Detect event when user clicks the program on the t

2019-02-18 14:47发布

I want to know which event is firing in wpf window form if the user click my application on the taskbar to minimize or maximize the application. I just tried Activated and Deactivated events and, it's not working.I mean these events are triggering so many times. Thanks.

2条回答
欢心
2楼-- · 2019-02-18 15:10

You can use stateChanged event of the window. It fires when window maximized and minimized i think it solves the problem.

hope this helps.

查看更多
劫难
3楼-- · 2019-02-18 15:13

The Window.StateChanged event is fired after your window is minimized, maximized, or restored.

However, if the window is simply obscured by other windows, clicking on the taskbar will bring it to front without changing its size. This will trigger the Activated event, but not StateChanged.

查看更多
登录 后发表回答