I'm having a bit of trouble understanding Static properties.
I have two forms and I need to be able to access a property from from1 in
form2.
The code below does not work but I'm not sure why not. And also why is it
necessary to declare the variable bIshShown twice?
Form1 code:
private static bool bIsShown = false;
public bool bIsShown
{
get{ return bIsShown; }
set { bIsShown = value; }
}
Form2 code:
form1.bIsShown = false;
Thanks,
Ron
I have two forms and I need to be able to access a property from from1 in
form2.
The code below does not work but I'm not sure why not. And also why is it
necessary to declare the variable bIshShown twice?
Form1 code:
private static bool bIsShown = false;
public bool bIsShown
{
get{ return bIsShown; }
set { bIsShown = value; }
}
Form2 code:
form1.bIsShown = false;
Thanks,
Ron
Comment