试试这个:对于Windows Forms:bool found = false;foreach (Control c in this.Controls){ if (c is Label && c.Text.Contains("abc")) { found = true; break; }}button1.Enabled = !found;对于WPF:bool found = false;for (int i = 0; i < VisualTreeHelper.GetChildrenCount(this.Content as DependencyObject); i++){ var v = VisualTreeHelper.GetChild(this.Content as DependencyObject, i); if (v is Label && (v as Label).Content.ToString().Contains("abc")) { found = true; break; }}button.IsEnabled = !found;