的WinForms - 的DataGridView - 没有选中的单元格 [英] WinForms - DataGridView - no cell selected
问题描述
有没有一种方法,使一个DataGridView选择无电池?我注意到,即使失去焦点(),它有一个至少有一个活动单元格。是否有另一种方式,可以让这个?或者一些其他的把戏?
Is there a way to make a DataGridView have no cell selected? I notice even when it loses focus() it has a at least one active cell. Is there another mode that allows this? or some other trick?
推荐答案
DataGridView.CurrentCell属性可以用来清除焦点矩形。
DataGridView.CurrentCell property can be used to clear the focus rectangle.
您可以设置该属性 (DataGridView.CurrentCell)为null 暂时删除焦点 矩形,但控制时 接收焦点并在此值 属性为null,它会自动为 设置的值 FirstDisplayedCell属性。
You can set this property (DataGridView.CurrentCell) to null to temporarily remove the focus rectangle, but when the control receives focus and the value of this property is null, it is automatically set to the value of the FirstDisplayedCell property.
<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspx">http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspx
这篇关于的WinForms - 的DataGridView - 没有选中的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!