且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单击按钮添加控件

更新时间:2021-10-11 08:21:15

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

您是否考虑过使用两个列表,而不是为每个职员和每个学生添加控件?大概是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?