private void btPlus_Click(object sender, EventArgs e) { FrmEdit frm = new FrmEdit(settings, AppDir); frm.prj = new Projet(); if (frm.ShowDialog() == DialogResult.OK) { frm.UpdatePrj(); lstprj.Projets.Add(frm.prj); SaveDB(); RefreshListbox(); RefreshFields(true); } }
private void btEdit_Click(object sender, EventArgs e) { int p = listBoxProjets.SelectedIndex; if (p == -1) { return; } FrmEdit frm = new FrmEdit(settings, AppDir); frm.prj = lstprj.Projets[p]; if (frm.ShowDialog() == DialogResult.OK) { frm.UpdatePrj(); SaveDB(); RefreshListbox(); //.. On repositionne le curseur listBoxProjets.SelectedIndex = p; //.. RefreshFields(true); } }