Hello:
I am cleaning my code and trying to make whatever I can global. Global might not be the right terminology.
I put most of my global variables in the 'program.cs' and its working fine.
Is there a way to put the instances in there or make global some other way?
This is the line I would like to make golbal:
FormICEPack FormICEPack = Application.OpenForms["FormICEPack"] as FormICEPack;
I have this line in many places and in many programs/forms. Would like to just have it once.
Loading
Hirendra SisodiyaPosted Apr 14, 2010, 2:15 AM
you can do in this way:
declare FormICEPack as public static in your program.cs like :
public static FormICEPack frmICEPack;
and youcan initialize this on another form or as you wish like:
frmICEPack = Application.OpenForms["FormICEPack"];
now you can use frmICEPack as program.frmICEPack in anywhere in your application..
thanks
Please mark as answere if it helps
GustavoPosted Apr 14, 2010, 4:25 PM
Thanks... I tried it in one form and it seems to work. Now I will go and do it to all my forms and then do my testing. Hopefully it will work all over. THANKS.