private void novyToolStripMenuItem_Click(object sender, EventArgs e) { using (NovyDialog dlg = new NovyDialog()) { if (dlg.ShowDialog() == DialogResult.OK) { pes = dlg.Pes; Prepis(); } pes = dlg.Pes; if (pes != null) { Prepis(); } } }