foreach (Control control in Controls) { Button button = control as Button; if (!ReferenceEqual(null, button)) { button.Visible = someConditionIfYoWant; } }
button1
button1.Visible
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)