本文介绍了C#表格生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以基于列表/数据库在表单上自动生成项目?
因此,例如,一个文本框和一个用于库存清单上每个项目的两个按钮,一旦创建了库存清单,就可以单击一个按钮,这将生成一个新表格.
Is it possable to auto generate items on a form based on a list/database?
So for example a text box and two buttons for each item on a stock list, once the stock list has been created a button can be clicked which would generate a new form.
推荐答案
Form f = new Form();
TextBox tb = new TextBox();
tb.Losition = new Point(...);
// define properties here
f.Controls.Add(tb);
只需对所有控件执行此操作,我认为您的表单将起作用.
干杯.
:rose:
Just do this for all controls and I think your form will work.
Cheers.
:rose:
这篇关于C#表格生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!