473,387 Members | 3,821 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.

getting the name of an event

If I have, let say, 3 event handlers,all pointing to the same method.
is there a way to find out which on invoked the method from within the method?

for example:
i have 3 event handlers

Expand|Select|Wrap|Line Numbers
  1. Grid1.MouseMove += new EventHandler(bla)
  2. Grid1.MouseDown += new EventHandler(bla)
  3. Grid1.MouseUp += new EventHandler(bla)
  4.  
  5. private void bla(object sender,EventArgs e)
  6. {
  7.   // what should I write here to find out if it was a mouse move , a mouse down 
  8.   // or a mouse up event.
  9. }
thanks in advance
Apr 14 '08 #1
3 881
Plater
7,872 Expert 4TB
Wouldn't you be better off using the correct event handlers for those events (the MouseEvents)?
Apr 14 '08 #2
Wouldn't you be better off using the correct event handlers for those events (the MouseEvents)?
i used those just for the example, it doesnt really matter as long as the question is clear. what i want is a way to find out which one called the method
Apr 15 '08 #3
Plater
7,872 Expert 4TB
Well I am not sure you can tell *scratches head*
I mean if you used the correct eventhandlers, they would all be different, but if you want to use a generic event handler, i'm not sure.
If they came from different controls the sender object could be used, but if it's the same control I'm not sure how.
Maybe something about the "currently executing assembly" could tell you?
Or if you were keeping track of the windows messages in the pump?
Apr 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Ray Muforosky | last post by:
I have this: ------------ print "<FORM name=\"form3\" ACTION=\"cmdlog_rep.php\">\n"; print "<TD><INPUT TYPE=\"submit\" VALUE=\"Submit\"></TD>\n"; .. print "<INPUT type=\"HIDDEN\"...
8
by: bryan | last post by:
Is there any way I can get the application path (the one returned by Request.ApplicationPath) in the Application_Start method in Global.asax? Request is not valid there. On a related note, is there...
6
by: Class | last post by:
Hi all, I create a gridview dynamicly because I don't know the columns in advance. I use the Templatefield to create a linkbutton. Everything fine..I have the postbackurl and it works. But now...
4
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.