代码:
private void btnShowName_Click(object sender, EventArgs e)
{
for (int intIndex = 0;intIndex<this.Controls; intIndex++)
{
MessageBox.Show("Control #" + intIndex.ToString() +
"has the name" + this.Controls[intIndex].Name);
}
}为什么有错误呢?
错误提示如下:错误 1 运算符“<”无法应用于“int”和“System.Windows.Forms.Control.ControlCollection”类型的操作数 D:\Documents\Visual Studio 2008\Projects\Picture\Picture\Form1.cs 63 35 Picture
private void btnShowName_Click(object sender, EventArgs e)
{
for (int intIndex = 0;intIndex<this.Controls; intIndex++)
{
MessageBox.Show("Control #" + intIndex.ToString() +
"has the name" + this.Controls[intIndex].Name);
}
}为什么有错误呢?
错误提示如下:错误 1 运算符“<”无法应用于“int”和“System.Windows.Forms.Control.ControlCollection”类型的操作数 D:\Documents\Visual Studio 2008\Projects\Picture\Picture\Form1.cs 63 35 Picture
解决方案 »
- 使用php网页调用客户端应用程序
- 一个字符串中有中文也有英文数字,怎么判断哪几个是中文,哪几个是英文?
- 如何在aspx文件内使用JS的属性.
- 求sql语句!!!!
- 为什么我引用:COM-->Microsoft Excel 11.0 Object Library写出的代码与网络上的不一样
- 一直用DELPHI做开发,为了赶潮流学了一段时间.NET(C#),因项目性质不同,我做的方面用VC 的多,现在不知道学习c++还是C#??????
- 我有两个os,A操作系统中装了.net,有没有办法在B操作系统中用A中的msdn?非常感谢(FriendLG)
- winform窗口:datagrid1或其他控件中将数据库表中的字段以列的方式如何显示?问题如下:
- java里的BigInteger.mod在c#里应该咋写呢?
- 求大神分析下C#的hook
- 在页面上动态添加控件的问题
- WinForms系统异常处理
{
for (int intIndex = 0;intIndex <this.Controls.Count; intIndex++)
{
MessageBox.Show("Control #" + intIndex.ToString() +
"has the name" + this.Controls[intIndex].Name);
}
} 没调试,你试试.如不行抱歉.
你在 < 右边应该是这个数组的长度