Bypass read only cells in DataGridView when pressing TAB key

前端 未结 8 721
粉色の甜心
粉色の甜心 2020-12-31 18:07

Can anyone show me some code of how I could bypass read only cells in DatagridView when pressing TAB key?

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 18:18

    private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
    {
       if (dataGridView1.CurrentRow.Cells[e.ColumnIndex].ReadOnly)
        {
            SendKeys.Send("{tab}");
        }
    }
    

提交回复
热议问题