我不是很明白你的意思﹐試試看下面這段代碼能不能幫到你.
Button objBtn = null;
int iIndex = 0;
int iCount = a.Length();for (iIndex=0;iIndex<iCount;iIndex++)
{
objBtn = (banner)a[iIndex];
objBtn.DoSomeThing();
}
Button objBtn = null;
int iIndex = 0;
int iCount = a.Length();for (iIndex=0;iIndex<iCount;iIndex++)
{
objBtn = (banner)a[iIndex];
objBtn.DoSomeThing();
}
解决方案 »
- 移动EMPP API开发问题,多线程发送会卡死
- asp.net listview内嵌dropdownlist
- 一个正则表达式在本机可以运行,但传到服务器上就不行了,.net环境的版本是一样的。
- 如何更改FolderDialog 的title
- 怎样判断某个dll是否已被Assembly.LoadFrom(),不给再次调用.
- 急!用.NET如何实现 “短信平台”也就是 “用一台内部服务器的USB接口,实现向手机发短信。。不通过Internet网" 谢谢^_^ 高分赠送啊。。
- 大量高分收购C#源码
- 急聘系统设计人员一名(兼职),诚聘各位星级人物。
- devexpress gridcontrol问题
- 讨论一个有意思的问题!
- 关联表的操作
- 请问那位高手知道在.NET中如何用C#写串口程序啊?协议是RS485的。
请参考微软社区的这篇文章:在 Visual Basic .NET 和 Visual C# .NET 中创建控件数组
http://www.microsoft.com/china/msdn/library/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasicNETVisualCNET.asp
listBox=new ListBox[20];listBox[i]=new ListBox();
for(int i=0;i<20;i++)
{
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listBox[i] }
}
..........
for( count=0;count<20;count++)
{
this.listBox[count].SelectedIndexChanged += new System.EventHandler(this.listBox_SelectedIndexChanged); }
,,,,,,,,,,,,,,,,,,,,,,
private void listBox_SelectedIndexChanged(object sender, System.EventArgs e)
{
try
{
for(int i=0;i<20;i++)
{
if(sender.Equals(listBox[i]))
{
所点击的是第I个LISTBOX;
}
}
}
catch(Exception exce)
{
MessageBox.Show(exce.Message.ToString()+count.ToString());
}
}
希望对你有帮助!!!!!!!!!!!
listBox=new ListBox[20];listBox[i]=new ListBox();
不好意思自已COPY半天原码。改了半天,所有有的东东可能多出来了。呵呵!
多了两个东东!
textBox=new TextBox[20];
listBox[i]=new ListBox();