textbox enter or GotFocus

B

Boki

Dear All,

What is the different between Enter and GotFocus events?

Best reagrds,
Boki.
 
C

Cerebrus

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.
 
P

Phill W.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top