public static Sample ShowWindow(string title, int v1, int v2)
 {
     res = null;
     AddEditSampleForm f = new AddEditSampleForm();
     f.numericUpDown1.Value = v1;
     f.numericUpDown2.Value = v2;
     f.Text = title;
     f.ShowDialog();
     return res;
 }
 private void button2_Click(object sender, EventArgs e)
 {
     res = new Sample((int)numericUpDown1.Value, (int)numericUpDown2.Value);
     Close();
 }