Hi, I'm trying to get a variable from the login form for my project and come across the code as shown below. How do I need to do in frmLogin for this IUserAccount user = frmLogin.UserAccount;? Thanks

static void Main()
{
FrmLogin frmLogin = new FrmLogin();

if(frmLogin.ShowDialog() == DialogResult.OK)
{
IUserAccount user = frmLogin.UserAccount;
Application.Run(new FrmMain(user));
}
}

Make frmLogin.UserAccount public.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.