I have some windows forms that each has some controls including buttons,ComboBox,... and also in each form i have a Bindingnavigator control that i added some new Toolstrip buttons to it, how can i write a general method that get 3 parameters and iterate all controls on a form(including that toolstrip buttons) and enable/disable Enabled status of an special control? my method signature is like this:
Public SetStatusOf(Form frm,string controlName,bool status)
From the question, and from what I understood, you need this:
but you can also directly use