WinForms - DataGridView - 没有选择单元格 [英] WinForms - DataGridView - no cell selected

查看:109
本文介绍了WinForms - DataGridView - 没有选择单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使DataGridView没有选择单元格?我注意到即使它失去了焦点(),它有至少一个活动单元格。还有另一种模式允许吗?还是一些其他的伎俩?

解决方案

DataGridView.CurrentCell属性可用于清除焦点矩形。




您可以将此属性
(DataGridView.CurrentCell)设置为null到
临时删除焦点
矩形,但是当控件
收到焦点,此
属性的值为null,它将自动
设置为
FirstDisplayedCell属性的值。


http:/ /msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspx


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 property can be used to clear the focus rectangle.

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.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspx

这篇关于WinForms - DataGridView - 没有选择单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆