What is the difference between the Control.Enter and Control.GotFocus events?

后端 未结 2 1738
无人及你
无人及你 2021-02-05 01:57

This may be a basic question, but I have to admit I\'ve never truly understood what the difference between the Control.Enter and Control.GotFocus events is.

http://msdn.

2条回答
  •  -上瘾入骨i
    2021-02-05 02:50

    Control.Enter event happens when a control gets focus for the first time. While Control.GotFocus happens EVERY time a control gets focus. For example, you have 'textBox1' that already has focus and you call textBox1.Focus(), the GotFocus event will always fire in this instance, unlike for the Enter event that will only fire if a control doesn't already have the focus and receives it for the first time.

提交回复
热议问题