Using separate class to handle events of Windows user controls
Good day. I have this scenario wherein I have a number of 'user controls' to be placed on C# Windows forms. These controls are reused which means that they are placed on the forms of our application, depending on the user. I want to keep all of the forms' events in a single separate class called "Events.cs".
In summary, these is how it goes:
1. The user chooses which controls to be included in the form.
2. Upon raising an event for a user control (clicking a button), the control will raise an event listed on the separate class (Events.cs).
3. The events class will be the one to access the main form (where the user controls are placed); and do the necessary changes to the form and perform commands like database access.
Is this possible? What is the best approach in doing this?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

bilnaadRank #2,169 · 655 reputationPosted Dec 23, 2004, 7:57 AM EST
MykonineRank #2,671 · 521 reputationPosted Dec 26, 2004, 12:01 PM EST