I have a Windows Form Application with all classes under the same namespace. I have 1.cs that contains a method title Login(). I create an instance of 2.cs which is a login window. Upon clicking a submit button on the login window, I would like to fire a Login(). How do I call Login() from the 2.cs? I have made Login() public, and I would assume that this would be a simple task, but I am at a loss. Thanks in advance.
**edit**
I am not used to working with Windows Forms, and as such, do not know how to properly call objects, in the same namespace, but in a different class. In 2.cs, do I create a new instance of the form on 1.cs, and then access the method as such. For example:
**edit**
I am not used to working with Windows Forms, and as such, do not know how to properly call objects, in the same namespace, but in a different class. In 2.cs, do I create a new instance of the form on 1.cs, and then access the method as such. For example:
Code:
private void btnSubmit_Click(object sender, EventArgs e)
{
string userPassword = txtAdminPassword.Text;
string adminPassword = AdminPassword();
if (userPassword == adminPassword)
{
frmInkFormulas form = new frmInkFormulas();
form.Login();
this.Close();
}
}
Comment