"Wil Peck" <wilpeck@hotmail.com> wrote in message
news:629532F1-4738-45C7-B1C6-7AD6EC15C576@microsoft.com...
> I'd read up on MSDN about the Control.GotFocus event
> (
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.gotfocus(VS.71).aspx).
> There are recommendations from Microsoft as to when GotFocus/LostFocus
> should be used vs. when Enter/Leave should be used.
>
> See the below snippet from MSDN....
>
> ----
>
> Note 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. For more
> information about the GotFocus and LostFocus events, see the WM_SETFOCUS
> and WM_KILLFOCUS topics in the Keyboard Input Reference section of the
> Platform SDK Documentation in the MSDN Library.
> CAUTION 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. For more information about the LostFocus event, see the
> WM_KILLFOCUS topic in the Keyboard Input Reference section, and the
> Message Deadlocks topic in the Messages and Message Queues section of the
> Platform SDK Documentation in the MSDN Library.
>
> ----
>
> "moondaddy" <moondaddy@newsgroup.nospam> wrote in message
> news:OvUbOIsMIHA.1208@TK2MSFTNGP03.phx.gbl...
>> I'm writing a vb.net 2.0 app and am wondering what's the difference
>> between the Enter and GotFocus events. I know that one fires before the
>> other, but other than that, what's the difference that would make me
>> choose one over the other?
>>
>> Thanks.
>>
>> --
>> moondaddy@newsgroup.nospam
>>