private void btnAddDataStation_Click(object sender, EventArgs e) { FormStation form = new FormStation(); form.DataChanged += new Action <EventArgs>(FormStation_DataChanged); form.ShowDialog(); }
private void gridStations_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } string staName = Convert.ToString(gridStations.Rows[e.RowIndex].Cells[0].Value); string postName = Convert.ToString(gridStations.Rows[e.RowIndex].Cells[1].Value); if (staName == "" || postName == "") { return; } FormStation form = new FormStation(staName.Trim(), postName.Trim()); form.DataChanged += new Action <EventArgs>(FormStation_DataChanged); form.ShowDialog(); }