473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Event order problem

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?

--
Rinze van Huizen
C-Services Holland b.v
Jan 31 '06 #1
3 1387
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

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl> schreef in bericht
news:WI********************@zeelandnet.nl...
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?

--
Rinze van Huizen
C-Services Holland b.v

Feb 1 '06 #2
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.

Peter Proost wrote:
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.


--
Rinze van Huizen
C-Services Holland b.v
Feb 1 '06 #3
Hi,

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

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl> schreef in bericht
news:or********************@zeelandnet.nl...
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.

Peter Proost wrote:
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.


--
Rinze van Huizen
C-Services Holland b.v

Feb 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Amir Hardon | last post by:
I am dynamically adding rows to a table, and each row have a button which removes it. I have successfully implemented this for mozilla but I'm having troubles with IE, here is how I did it: ...
4
by: Dave H | last post by:
I originally posted a message "Getting the current cursor position using clientX,clientY" in which I hypothesised that the problem I was having was related to event handler execution order. I am...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
2
by: Frank Schumacher | last post by:
Hi Folks, I have a problem with the order of events fired by ASP.NET. I found many articles which explaining the lifecycle of a site, but I found none which took the event from a Control on the...
4
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
11
by: ChrisM | last post by:
Hi, Don't know if anyone can cast any light on this... I have a fairly complex C# WinForm with (amongst other) a text box and a button. The TextBox has events declared for KeyUp and KeyDown,...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
6
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.