繁体   English   中英

按下Tab键时如何跳过datagridview中的列

[英]How to skip a column in datagridview when the tab key is pressed

按下Tab键 / 箭头键时,是否可以跳过某些列?

假设我有三列( col1col2col3 )。 假设我在col1 ,那么在按Tab键时我想跳过col2

我怎样才能做到这一点?

您可以在CellEnter事件中执行此操作

尝试这个:

    private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
    {           
        if (dataGridView1.Columns[e.ColumnIndex].Name == "col2")
        {
            SendKeys.Send("{TAB}");
        } 
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM