I have program that consists of multiple forms. Each of the forms share a common variable which I stored in the main form. But to access the variable from another form, I have to type something quite long like this:
MainForm.CommonVar.Function(arg1, arg2, arg3, arg8)
I use this many times in the other forms and would like to know if there is any way I could use it just like this:
CommonVar.Function(arg1, arg2, arg3, arg8)
I tried to Import the whole MainForm namespace. It worked but it reveals all the variables in the main form, something which I don't want. I used this code to import the MainForm namespace:
Are there any other way which can make only the required variable visible in all forms?