C#.net中的动态属性 [英] Dynamic Property in C#.net

查看:63
本文介绍了C#.net中的动态属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在Windows应用程序的C#.net中寻找动态属性.表单中的一个flowLayoutpanel.动态属性是``组''框,图片框和标签在该flowLayoutPanel中.我的问题是当我单击``一个图片框''时,标签文本应更改并另一个图片框的图片应该更改.请帮助我如何完成此任务?.
问候,
Lakshmi Narayanan.S

Hi,
I am looking for Dynamic Properties in C#.net in Windows application.One flowLayoutpanel in the form.Dynamic properties are Group box ,Picture Boxes and Labels In that flowLayoutPanel.My question is when i click the One Picture Box ,Label text should change and another picture box picture should change .please help me How to do this task ?.
Regards,
Lakshmi Narayanan.S

推荐答案

据我所知,通过键入动态属性"可以理解为在运行时创建的控件".
如果是这种情况,那么我将创建一堆业务对象来表示这些控件后面的数据(图片框的图像,标签的字符串,组框的枚举或任何适合您的需求).

然后单击图片框将使某些对象以您定义的方式做出反应.这可能包括更改某些其他控件或将消息发送到其他对象,这些对象进而对更改某些控件做出反应.

通常,很难详细说明.至少在不知道您的需求的情况下.
From the context I understand by typing "Dynamic properties" you mean "controls created at runtime".

If that''s the case, then I would create a bunch of business objects that represent the data behind those controls (Images for picture boxes, Strings for labels, Enumerations for group boxes or whatever suits your needs).

Then clicking on a picture box would cause some object to react in a way you define. That could include changing some other controls or sending messages to other objects that in turn react in changing some controls.

Generally, it''s hard to tell in detail. At least without knowing your needs.


这篇关于C#.net中的动态属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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