How do I find out which control has focus in .NET Windows Forms?

前端 未结 7 1221
逝去的感伤
逝去的感伤 2020-12-03 21:06

How do I find out which control has focus in Windows Forms?

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 21:36

    You can use the ActiveControl propert of the form and can use that control.

    me.ActiveControl
    

    Or

    Form.ActiveControl
    

提交回复
热议问题