private void PreferencesButton_Click(object sender, EventArgs e) { using(PreferencesDialog pd = new PreferencesDialog()) { pd.ShowDialog(this); } }