G
Guest
Hi,
I need to access some components on my main form. I found out that making a
static public variable it is accessible. It has to be from several forms,
so I dont want to pass a reference of main form to all of them. Is thsi a
preferred way of coding ?
partial class Main: Form
{
static public Main MainForm;
public Main()
{
InitializeComponent();
MainForm = this;
I need to access some components on my main form. I found out that making a
static public variable it is accessible. It has to be from several forms,
so I dont want to pass a reference of main form to all of them. Is thsi a
preferred way of coding ?
partial class Main: Form
{
static public Main MainForm;
public Main()
{
InitializeComponent();
MainForm = this;