In a Windows Forms Application project, you can make communication happen among forms by using events. To raise custom events, you can make use of
EventHandler delegates with
EventArgs as argument. However, built-in
EventArgs does not allow you to pass data as payload. So, by default, if you want to pass data among the forms, you will have to make use of both events (to indicate that the data has changed) and properties (to access the changed data). But there is another way – to extend
EventArgs and add the capability to accept payloads. This recipe will tell you how to do it.
During the process of implementing the custom
EventArgs by extending
EventArgs, one point to keep in mind is that ...