textbox enter or GotFocus

  • Thread starter Thread starter Boki
  • Start date Start date
From the docs :

The GotFocus and LostFocus events are low-level focus events that are
tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically,
the GotFocus and LostFocus events are only used when updating UICues.

The Enter and Leave events should be used for all controls except the
Form class, which uses the Activated and Deactivate events.

Regards,

Cerebrus.
 
Boki said:
What is the different between Enter and GotFocus events?

GotFocus and LostFocus are "low-level" events that Our Friends in
Redmond would prefer us not to use any more.
Enter and Leave are their respective replacements.

Also, bear in mind the caution tone of this MSDN article:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.gotfocus(VS.80).aspx


specifically

"Do not attempt to set focus from within the LostFocus event handler.
Doing so can cause your application or the operating system to stop
responding ..."

8-o

Regards,
Phill W.
 
Back
Top