如何创建tablelayoutpanel的对象数组? [英] How can I create an array of objects of a tablelayoutpanel?
本文介绍了如何创建tablelayoutpanel的对象数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在c#中创建一个tablelayoutpanel的对象数组,如:
Hi,
I want to create an array of objects of a tablelayoutpanel in c# like:
Tablelayoutpanel[] tb=new Tablelayoutpanel[10];
请建议我如何实现这一目标?
Please suggest me some ideas how can i achieve this?
推荐答案
如果你也是记得C#是一种区分大小写的语言。除此之外,您的代码行是正确的。之后你需要执行一个从0到tb.Length - 1
的循环,并使用元素类型的构造函数实例化每个数组元素。
-SA
You would already achieve that if you also remembered that C# is a case-sensitive language. Other that that, your line of code is correct. After that you would need to execute a loop from 0 totb.Length − 1
and instantiate each array element using the element type's constructor.
—SA
这篇关于如何创建tablelayoutpanel的对象数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文