private void 批次修改時數ToolStripMenuItem_Click(object sender, EventArgs e) { ServiceDataRow sdr = (ServiceDataRow)dataGridViewX1.CurrentRow.DataBoundItem; ChangeIntForm ctf = new ChangeIntForm("時數", sdr.Hours); DialogResult dr = ctf.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.Yes) { foreach (DataGridViewRow row in dataGridViewX1.SelectedRows) { sdr = (ServiceDataRow)row.DataBoundItem; sdr.Hours = ctf.ChangeInt; } } }