Set Container class value from contained class
Sounds a simple question but haven't found a way to do, so would solicit any responses I get.
I have a winform which in turn contains a user control object. based on some condition in the user control, i have to set a value in the winform. One way could be to pass the winform object as parameter to user control but that would give cyclic dependenc开发者_如何学JAVAy. Is there a easy way out?
You can always use events from the user control to the form.
- User Control Events in VB and C#
- Writing C# Custom Events
Usually I would expose an appropriate event from the usercontrol. The form can subscribe to the event and react accordingly.
精彩评论