private void metroButton4_Click(object sender, EventArgs e) { StudentsForm students = new StudentsForm(); // combobox holding the class names students.ClassID = (int)metroComboBox1.SelectedValue; students.ClassName = metroComboBox1.Text; students.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { var ff = new StudentsForm(new Students { Birthday = DateTime.Now }); if (ff.ShowDialog(this) == DialogResult.OK) { listBox1.Items.Add(ff.Students); } }