Event order problem

  • Thread starter C-Services Holland b.v.
  • Start date
C

C-Services Holland b.v.

I've got a problem with the order of events in a textbox. The order of
events seems to occur like this when I press esc:

tb1.leave
tb1.validate
tb1.lostfocus
tb2.gotfocus
tb1.keyup

tb1 and tb2 being textboxes.

something like that. Why is my keyup event not processed first? I need
to get that first to handle stuff like Escape and Return so I can
check/undo/cancel stuff. Is there a setting I missed?
 
P

Peter Proost

Hi do you use the keydown of tb1 to check if esc is pressed and then set the
focus to tb2? Because then I'm surprised that tb1 would fire his keyup
event. But I'm not completly sure what you want by reading your explanation.

Greetz Peter
 
C

C-Services Holland b.v.

I do not fire any events by myself. Apparently if you press enter in a
textbox it will automatically set focus to the next control and it does
this before the keydown/press/up event is fired. I am working on a
special datacolumn to suit our needs and insert a modified sle when the
user wants to edit something in the grid. When they press enter or esc
the focus is removed, switched to the next textbox (not my own but the
datagrid's textbox) and then that box fires it's gotfocus event and only
then the keyup event seems to register. I expected the keypress events
to occur first but apparently they get moved to the back of the row.

Currently I've solved my little problem by implementing it a different
way, but the order of events is still a mystery to me. Maybe it's
something to do with the datagrid, I'll see if I can whip up an example
and hope I can get it here because this computer is disconnected from
our internal network.
 
P

Peter Proost

Hi,

a sample would be nice because I can't seem to reproduce the behavior you
get

Greetz Peter
 

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

Top