Hello all, below code will work perfectly fine, use 'hide()' method to hide the current form and open another form using 'Show()' method on the new forms instance,
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
private void Login_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if(txtUnm.Text == "Optiq" && txtPwd.Text == "vision_13")
{
this.Hide();
var formConfig = new FormConfiguration();
formConfig.Show();
}
else
{
MessageBox.Show("Invalid username and password");
}
}
}