Re: Application-wide Objects in Windows Forms Apps



On Sun, 5 Oct 2008 14:11:00 -0700, Alex Maghen
<AlexMaghen@xxxxxxxxxxxxxxxx> wrote:

Let's say I have a Windows Forms app (.exe) and it has several Forms. How can
I create an object that is automatically accessible "globally" (to all Forms,
Classes, etc. running in the application)? Does such a Global space exist in
a Windows Forms Application?

Thanks.

Alex

There are several ways to do this.

1. Build a class with static (Shared in VB) methods and properties.

2. Build a class that is instantiated only once (Singleton).
.