开发者

Set Container class value from contained class

开发者 https://www.devze.com 2022-12-14 01:39 出处:网络
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 contr

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消