如何通过键盘检查或取消选中DataGridView中的CheckBox列 [英] How to check or uncheck CheckBox column in DataGridView from keyboard
本文介绍了如何通过键盘检查或取消选中DataGridView中的CheckBox列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个DataGridView
,在其中我从TextBox
列中的键盘输入数据.
该行中有一个CheckBoxColumn
.
对于选中或取消选中此列,我找不到键盘快捷键,因此每次我都必须使用鼠标选中或取消选中该快捷键时.
哪个键盘快捷方式可以选中或取消选中DataGridView
的CheckBoxColumn
?
I have a DataGridView
, in which I enter the data from keyboard in TextBox
columns.
There is a CheckBoxColumn
in the row.
For checking or unchecking this column I could not find a keyboard shortcut, due to which every time I have to check or uncheck using the mouse.
Which is the keyboard shortcut to check or uncheck the CheckBoxColumn
of DataGridView
?
推荐答案
您可以使用SpaceBar
选中或取消选中CheckBoxColumn
单元格在DataGridView
控件中.
You can useSpaceBar
to check or uncheck theCheckBoxColumn
cell inDataGridView
control.
您可以做的就是按下键,检查键盘组合,然后更改复选框的状态.这可能必须在表单级别完成,并且必须检查网格是否具有焦点,然后转到选定的行.
What you can do is catch the key down, and check for the keyboard combination, then change the state of checkbox. This will probably have to be done at the form level, and will have to check if the grid has focus, then go to the selected row.
这篇关于如何通过键盘检查或取消选中DataGridView中的CheckBox列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文