Determine if current application is activated (has focus)

前端 未结 7 774
情歌与酒
情歌与酒 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:47

    since it's likely that some element in your UI has contain focus for the form to be active try:

    this.ContainsFocus
    

    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.containsfocus(v=vs.110).aspx

提交回复
热议问题