hi, i want declare on form as global variable and then work with that in app. i dont want use below method to access app forms.
Form1 myForm = new Form1();
anyone have any idea?
thanks
hi, i want declare on form as global variable and then work with that in app. i dont want use below method to access app forms.
Form1 myForm = new Form1();
anyone have any idea?
thanks
my way is declaring a static class which have static variable Form1.
public static class Global
{
private static Form1 myForm = new Form1();
public static bool Show()
{
myForm.Show();
}
public static bool Hide()
{
myForm.Close();
}
}
it's not good way?
Looks like you want your form to be a Singleton, which isn't my favourite pattern, but it beats a global.