This is a multi-part message in MIME format.
------=_NextPart_000_0021_01C5F52E.1C9DEDE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I have added few of the events in some control, example code is:
btnControl.GotFocus +=3Dnew EventHandler(EventHandlingMethod);
btnControl.Click +=3Dnew EventHandler(EventHandlingMethod);
lblControl.Click +=3Dnew EventHandler(EventHandlingMethod);
private void EventHandlingMethod(object sender, EventArgs e)
{
.......
}
btnControl =3D Button object, lblControl =3D Lable object
Now the problem is: I am adding the same event handler method in all =
events for btnControl and lblControl too.
now in EventHandlingMethod method, i can find which control is using =
sender but now if i want to put some switch cases in the method for =
Event Name then I have no any such information in the eventargs or =
anyother way....
Can someone help/guide me to get the event name?
Is it possible? if yes then how? If no, then any work around?
Thanks in Advance
Regards,
Mahesh Devjibhai Dhola
------=_NextPart_000_0021_01C5F52E.1C9DEDE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1522" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have added few of the events in some =
control,=20
example code is:</FONT></DIV>
<DIV>
<P><FONT face=3DArial color=3D#0000ff size=3D2><EM>btnControl.GotFocus =
+=3Dnew=20
EventHandler(EventHandlingMethod);<BR>btnControl.Click +=3Dnew=20
EventHandler(EventHandlingMethod);<BR>lblControl.Click +=3Dnew=20
EventHandler(EventHandlingMethod);</EM></FONT></P>
<P><FONT face=3DArial color=3D#0000ff size=3D2><EM>private void=20
EventHandlingMethod(object sender, EventArgs =
e)<BR>{<BR> =20
.......<BR>}</EM></FONT></P>
<P><EM><FONT face=3DArial color=3D#0000ff size=3D2>btnControl =3D Button =
object,=20
lblControl =3D Lable object</FONT></EM></P>
<P><FONT face=3DArial size=3D2><EM><FONT color=3D#0000ff>Now</FONT></EM> =
the problem=20
is: I am adding the same event handler method in all events for =
btnControl and=20
lblControl too.</FONT></P>
<P><FONT face=3DArial size=3D2>now in EventHandlingMethod method, i can =
find which=20
control is using sender but now if i want to put some switch cases in =
the method=20
for Event Name then I have no any such information in the eventargs or =
anyother=20
way....</FONT></P>
<P><FONT face=3DArial size=3D2>Can someone help/guide me to get the =
event=20
name?</FONT></P>
<P><FONT face=3DArial size=3D2>Is it possible? if yes then how? If =
no, then any=20
work around?</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks in Advance</FONT></P>
<P><FONT face=3DArial size=3D2>Regards,<BR>Mahesh Devjibhai=20
Dhola</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0021_01C5F52E.1C9DEDE0--