如何修改 FlowLayoutPanel 中动态添加的元素?
我创建标签并将其添加到面板。
`for (int i=0; i<10; i++)
{
Label nlabel = new Label();
nlabel.text = "Label no."+i.toString();
nlabel.name = "label"+i.toString();
flowLayoutPanel1.Controls.Add(nlabel);.
}`
创建和添加后我想引用元素“i”。
该面板没有方法 FlowLayoutPanel.getItem(int index)
;(
怎么做?
感谢回答。
最佳答案
就像所有控件一样,FlowLayoutPanel
有一个 Controls
集合属性,您可以按序号或名称对其进行索引。
关于c# - 修改 FlowLayoutPanel 中动态添加的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33962519/