Click here to Skip to main content
15,911,485 members
Please Sign up or sign in to vote.
2.50/5 (4 votes)
See more:
Hi all,
I am supposed to handle an event in my project (c#,, visual studio ).

There are two files related to a form. there is key_down event in both the files.
How can i make out that which file's event is called first.

I have a guess that in one file the events is never called.

Help me out to solve this issue.
Posted
Updated 10-Mar-11 19:02pm
v2

Using Visual Studio DEBUGGER? What say?
 
Share this answer
 
Comments
arunmj 11-Mar-11 1:55am    
i already tried it ,, but any way thanks
Olivier Levrey 11-Mar-11 3:28am    
This should be enough. My 5.
arunmj 11-Mar-11 3:45am    
thanks sandeep and oliver,,
problem is almost solved...
Sandeep is right. Just put a break point into both handlers, run your app in debug mode, hit a key and see where you stop first.

Normally, your handlers should be called in the same order of the assignements:

...
{
     //first assignement
     MyEvent += MyEventHandler1;
     //Second assignement
     MyEvent += MyEventHandler2;
}

void MyEventHandler1(object sender, EventArgs e)
{
    //will be called first
}
void MyEventHandler2(object sender, EventArgs e)
{
    //will be called after
}
 
Share this answer
 
v2
Comments
arunmj 11-Mar-11 3:45am    
ok ........
Olivier Levrey 11-Mar-11 3:59am    
I updated my answer. The first one was not very helpful...
arunmj 14-Mar-11 6:27am    
thankss olivier

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900