如何在主窗体中使用用户控件复选框事件。 [英] how to use user control check box event in main form.

查看:122
本文介绍了如何在主窗体中使用用户控件复选框事件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用应用程序中的C#窗口设计GUI。我最近开始学习c#。我在用户控件中有一个复选框,当chekbox被更改时,我想在mainfrom中引发该事件。我怎么能这样帮助我。



在此先感谢,

Hi,

i am designing GUI using C# windows from application.I have started learning c# recently. I have one checkbox in user control and when chekbox is changed i want to raise that event in the mainfrom. how can i do this please help me.

Thanks in advance,

推荐答案

简单:您的用户控件直接从CheckBox处理事件,并将它自己的事件发送到父表格。

这很简单 - 看看这个:在两种形式之间传递信息,第2部分:儿童到父母 [ ^ ]它针对的是父母和子女形式,但是原则,原因和技术完全相同。
Simple: your user control handles the event from the CheckBox directly, and signals it''s own event onward to the parent form.
It''s very simple - have a look at this: Transferring information between two forms, Part 2: Child to Parent[^] It''s aimed at parent and child forms, but the principles, reasons and techniques are exactly the same.


这篇关于如何在主窗体中使用用户控件复选框事件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆