private void addActionButton_Click(object sender, EventArgs e) { AddActionForm src = new AddActionForm(); src.setTaskid(getSelectedTaskId()); src.ShowDialog(); if (src.DialogResult == DialogResult.OK) { updateEndAction(); } }