S
sck10
Hello,
I am trying to call a class and send the form as a parameter, but I don't
know the syntax. In ASP, you would use "this.Page" as an example:
HidePanelsHelper.HidePanels(this.Page)
My question is what is the syntax for sending the form to a class?
Thanks, sck10
In my Form, I have the following:
protected void AppCodeHidePanels()
{
General HidePanelsHelper = new General();
HidePanelsHelper.HidePanels(What goes here);
}
In my class, I have the following:
public void HidePanels(Form MyForm)
{
foreach(Control ctrl in MyForm.Controls)
{
if(ctrl is Panel)
{
((Panel)(ctrl)).Visible = false;
}
}
}
I am trying to call a class and send the form as a parameter, but I don't
know the syntax. In ASP, you would use "this.Page" as an example:
HidePanelsHelper.HidePanels(this.Page)
My question is what is the syntax for sending the form to a class?
Thanks, sck10
In my Form, I have the following:
protected void AppCodeHidePanels()
{
General HidePanelsHelper = new General();
HidePanelsHelper.HidePanels(What goes here);
}
In my class, I have the following:
public void HidePanels(Form MyForm)
{
foreach(Control ctrl in MyForm.Controls)
{
if(ctrl is Panel)
{
((Panel)(ctrl)).Visible = false;
}
}
}