I have two forms "login form" and "dashboard form". When i successfully connected to database through login form, it hides and dashboard form appears. But the problem is, even if i close dashboard form, my application is still running in background. 

What should i do to avoid my application run in background?

This is my code

```
 private void button1_Click(object sender, EventArgs e)
    {
       this.Hide();
       Form2 form = new Form2();
       form.ShowDialog();
    }

```