A strange behaviour of GotFoucus Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi Al
I am using a data grid there is a date time picker control in one its columns.I wanna do something on GotFocus vent of DateTime Picker Control.But the thing that is very strange (rather annoying) is that when the control got focus the evnt is fired not for once but for one GotFocus event it fired for 13 time
Whenever the control got focus. I am unable to find any reason for this. Other vents like leave, close up are behaving normally, what's wrong with GotFocus
 
Qumer Mumtaz said:
hi All
I am using a data grid there is a date time picker control in one its
columns.I wanna do something on GotFocus vent of DateTime Picker Control.But
the thing that is very strange (rather annoying) is that when the control
got focus the evnt is fired not for once but for one GotFocus event it fired
for 13 time.
Whenever the control got focus. I am unable to find any reason for this.
Other vents like leave, close up are behaving normally, what's wrong with
GotFocus?
I have seen all kinds of questions/problems posted about the GotFocus and
LostFocus events. While I do not know the exact reason for your issue, I do
know that Microsoft's help files recommend using the Enter and Leave events
instead:

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

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

Back
Top