当用户点击任务栏上的程序检测事件? [英] Detect event when user clicks the program on the taskbar?
问题描述
我想知道哪些事件在WPF窗口的形式发射,如果用户单击任务栏上我的应用程序最小化或最大化应用程序。我只是试图激活和停用的事件,它不是working.I意味着这些事件引发了很多次。谢谢。
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.
推荐答案
的 Window.StateChanged
事件被触发后,你的窗口最小化,最大化,或恢复。
The Window.StateChanged
event is fired after your window is minimized, maximized, or restored.
然而,如果窗口被简单地被其它窗口遮挡,点击任务栏上的将它带到前面,而不改变其大小。这将触发激活
事件,而不是 StateChanged
。
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
.
这篇关于当用户点击任务栏上的程序检测事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!