foreach (Control myControl in this.grpRole.Controls )
{
if (myControl.GetType()==this.chk1.GetType())
{
((CheckBox)myControl).Checked=false;
}
}
这个是遍历的。得到类型我不会阿。。
{
if (myControl.GetType()==this.chk1.GetType())
{
((CheckBox)myControl).Checked=false;
}
}
这个是遍历的。得到类型我不会阿。。
解决方案 »
- 帮忙看看这个数据库的访问类是否有问题?
- 导出csv的代码完全正常,就是导出身份证号码时,用excel打开后是科学计数法,如何办?
- “CheckValidationResult”的重载均与委托“System.Net.Security.RemoteCertificateValidationCallback”不匹配
- 对GDI+有个莫名其妙的问题
- 安装.net2005是不是必须得先装sql server2005
- C#做b/s结构的数据库程序和网络编程是否合理?
- 如何用代码实现退到上一页?
- 对Microsoft .NET Compact Framework有兴趣的来看看啦
- 百分求解关于域与c#的问题
- 菜鸟的一个调查,有兴趣的朋友可以进来看看!!
- 谁有交友网站的C#源代码,一起建个网站或卖给我也行。
- 小弟向各位前被请教 --怎样把多个网页文件组成一个大的页面?
{
if (conSel is TextBox)
{
////...
}
else if (conSel is DateTimePicker)
{
////...
}
....
}
ComponentCollection components = this.Components;
foreach (Component NextComponent in components)
{
Type myType = NextComponent.GetType();
//进行处理
}
foreach (Component NextComponent in this.components.Components)
{
Type myType = NextComponent.GetType();
//进行处理
}
其中components是在form中声明的一个IContainer对象