bool state = false; foreach (Timer var in this.Controls) { if (var is Timer) { state = var.Enabled; MessageBox.Show(state.ToString()); } }
foreach (Component c in this.) { if (c is Timer) { MessageBox.Show("我的"); } }