954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Custom UserControls Throwing Events Up the Hierarchy

I spent a lot of time looking around, and all I could find was in ASP.NET, and it is a technique called "bubbling", but I need do something similar using WinForms.

I have a Form with a Split Container, and on the right side of the container, depending on the App_State, there is a TabControl, and within that there is a pantheon of shiny buttons and blinky textboxes.

The only way I've been able to capture events from the Top Form level is by setting my Controls as public and then adding EventHandlers and implementing them.

This is a sticky way of doing it, I am hoping to be able to separate the objects a bit more to avoid spaghettifying my code.
I assume that it is better to keep the events within the seperate objects, if I am wrong, please correct me. I don't really have a solid understanding of Events/Delegates.

MetalHobin
Newbie Poster
9 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You