private void button4_Click(object sender, EventArgs e) { if (eventList.Rows.Count > 0) { DataRow dr = this.dtEventList.Rows[eventList.SelectedRows[0].Index]; ScheduleTime form = new ScheduleTime(this, dr); form.ShowDialog(); } else { MessageBox.Show("Nothing to Show"); } }