コード例 #1
0
 private void DBGrid_MouseDown(object sender, MouseEventArgs e)
 {
     if (txtEmployeeId.ReadOnly == true && e.Button == MouseButtons.Left)
     {
         DataGridView.HitTestInfo info = DBGrid.HitTest(e.X, e.Y);
         if (info.RowIndex >= 0)
         {
             DataGridViewRow dr = (DataGridViewRow)DBGrid.Rows[info.RowIndex];
             if (dr != null)
             {
                 DBGrid.DoDragDrop(dr, DragDropEffects.Copy);
             }
         }
     }
 }