I've got an MDIParent and I've opened a child window. I need to close the current parent if button is clicked. So I've tried the code below
private void button_log_Click(object sender, EventArgs e)
{
MDIParent_Main obj = new MDIParent_Main(textBox_username.Text);
obj.Show();
this.Close();
}
The problem is it's closing both MDIParent_Main and child form. Where is my error?