Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

Access object from more than one form

I have an object that I need to access from two forms.

frmLogin
frmMain

On frmLogin I need to open the connection and validate the user.
On frmmain i will need to work with the methods and events of CmiServer


//frmLogin
frmMain.CmiServer.OpenConnection()


//frmMain
        public static CmiServer CmiServer
        {
            get
            {
                if (_cmiServer == null)
                {
                    _cmiServer = new CmiServer();
                }

                return _cmiServer;
            }
        }


Are there other/better ways to do this?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial