首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

怎么遍历Winform中的组件(Component)

2012-03-06 
如何遍历Winform中的组件(Component)?在Winform中能通过Controls遍历每个控件,但Component就没有,请问如何

如何遍历Winform中的组件(Component)?
在Winform中能通过Controls遍历每个控件,但Component就没有,请问如何遍历每个Component?谢谢!

[解决办法]
foreach(System.ComponentModel.Component com in this.components.Components)
{
If(com is Timer)
{
Console.WriteLine( "Is Timer ");
}
}

热点排行