单击按钮添加控件 [英] Add controls on button click

查看:106
本文介绍了单击按钮添加控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
根据我的要求,我想给增加员工及其亲戚学生的机会.因此,一个员工将有更多的学生.我想让天真的用户创建动态控件,以便增加更多的员工和更多的学生.有人可以帮忙吗?

预先感谢,
Karan

Hi all,
as my requirement, i want to give provision to add staff''s and their relavent students.hence, one staff will have more students. i would like to give provision to naive user to create dynamic controls so as to add more staff and more students. can anyone help on this please?

Thanks in advance,
Karan

推荐答案

动态添加控件并不是很难-只需创建控件实例并将其添加到控件"列表中即可-但我认为这不是一个好方法您的应用程序的主意.

您是否考虑过使用两个列表,而不是为每个职员和每个学生添加控件?大概是DataGrid还是类似的?这样,您的页面将保持不变,但是页面上的数据将可更改?
Adding controls dynamically is not too difficult - just create the control instance and add it to the Controls list - but I don''t think it is a good idea for your application.

Instead of adding controls for each member of staff and each student, have you considered using two lists instead? Probably a DataGrid or similar? That way your page would remain the same, but the data on it would be changeable?


这篇关于单击按钮添加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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