I have a Windows Forms Add-in on Revit using Revit-API and C#. The project contains two forms ( Main form and About form). the About form opens by a button click in the main form. The problem is that when I try to close the About form through the Control box or by using a button inside it About.ActiveForm.Close()
it automatically closes all the Forms. I tried About.ActiveForm.Hide()
and also doesn't work. Also, I tried to link the Cancel Button of the about form to that button and it didn't work.
Code of initiating the About form
private void button3_Click(object sender, EventArgs e)
{
About abt = new About();
abt.ShowDialog(this);
}
Code of Closing the About Form
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
I also tried this for the closing part
private void button3_Click(object sender, EventArgs e)
{
Close();
}
and I tried this also for the initiating part
private void button3_Click(object sender, EventArgs e)
{
About abt = new About();
abt.ShowDialog();
}