private void createQRButton_Click(object sender, EventArgs e) { using (QRDialog qrDialog = new QRDialog(GetPattern())) qrDialog.ShowDialog(); }