Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
Hello All,


Any one tell me how to we add a user define parameter in an event like this
original event :::private void buttonprocess_Click(object sender, EventArgs e)

and i want to change
private void buttonprocess_Click(object sender, EventArgs e,DataGridViewEventArgs e)

how is it possible?



Thanks
Posted
Updated 3-Jul-14 2:10am
v3
Comments
johannesnestler 3-Jul-14 9:18am    
Maybe think again if this is really what you want to do. In case of your click event you should not need a "Parameter" but some Kind of "state" - this should be provided by the sorrounding class (a member variable) and accessed inside the Click-Events logic. of course you can subclass a control and implement your "extended" click Event, but I doubt that you need that.
Marcin Kozub 3-Jul-14 9:30am    
Maybe you can tell us more about what are you trying to achieve? Why you need DataGridViewEvents in ButtonClick event? ButtonClick event is raised when user clicks on button nothing more. What action you need to do in that event?

This link may help you.

How to Create an Event for a User Control[^]

Regards
Skhan
 
Share this answer
 
If you want to expose customize event on system define user control you need to inherit it.

Now create a delegate with your desire signature

http://msdn.microsoft.com/en-IN/library/ms173176.aspx[^]

Multicast : http://msdn.microsoft.com/en-us/library/ms173175.aspx[^]

How to create an event

http://msdn.microsoft.com/en-us/library/8627sbea(v=vs.71).aspx[^]

Now call your event from the button click
 
Share this answer
 
This is helpful to create a event.
[A Simple Code Snippet to Add an Event[^]^]
 
Share this answer
 

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