S
sck10
Hello,
I just started using WinForms and built the following to hide panels:
private void AppCodeHidePanels()
{
foreach(Control ctrl in this.Controls)
{
if(ctrl is Panel) ((Panel)(ctrl)).Visible = false;
}
}
I would like to move this to a class so that All my forms can use the same
code. My question is how do I reference the form that is calling it. I am
assuming that you can't use "this.Controls".
Thanks,
sck10
I just started using WinForms and built the following to hide panels:
private void AppCodeHidePanels()
{
foreach(Control ctrl in this.Controls)
{
if(ctrl is Panel) ((Panel)(ctrl)).Visible = false;
}
}
I would like to move this to a class so that All my forms can use the same
code. My question is how do I reference the form that is calling it. I am
assuming that you can't use "this.Controls".
Thanks,
sck10