When changing with a mouse, the LostFocus occurs, followed by Leave, then
the validation, making them appear almost synonymous.
The difference is when, according to MSDN, changing Focus of a control by
key press, or progmatically. Leave occurs before any validation, and the
LostFocus after. Almost PreLooseFocus as PostLooseFocus type events.
Use Leave on a control, except, as documentation puts it when checking User
Interface Cues:
"This enumeration is used to specify which user interface cues will be
displayed or changed. For example, when the user presses the ALT key, the
keyboard shortcuts on the menu are displayed by underlining the appropriate
character. The bitwise combination of UICues for this example would be
ShowKeyboard and ChangeKeyboard."
"vooose" <no****@microsoft.com> wrote in message
news:On****************@TK2MSFTNGP11.phx.gbl...
Does anyone know the difference between these two?
The doc for LostFocus says
'Occurs when the control loses focus.'
whereas for Leave it says
'Occurs when the input focus leaves the control'
The doc also states that for controls losing focus you should use Leave,
so I do. Another reason I used it is because comboBox.LostFocus event
was being fired when it gained focus, and then again when it lost focus!
Wal
--
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!