Determine if current application is activated (has focus)

前端 未结 7 772
情歌与酒
情歌与酒 2020-11-27 15:26

Note: There\'s a very similar question, but it\'s WPF-specific; this one is not.

How can I determine if the current application is activ

7条回答
  •  感情败类
    2020-11-27 15:55

    In WPF the easiest way to check if a window is active is:

    if(this.IsActive)
    {
     //the window is active
    }
    

提交回复
热议问题