JRockFL
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.OpenConn ection()
//frmMain
public static CmiServer CmiServer
{
get
{
if (_cmiServer == null)
{
_cmiServer = new CmiServer();
}
return _cmiServer;
}
}
Are there other/better ways to do this?
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.OpenConn
//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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.