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

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

问题描述

有没有办法让 DataGridView 没有选择单元格?我注意到即使它失去了 focus() ,它也至少有一个活动单元格.是否有另一种模式允许这样做?或其他什么技巧?

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暂时移开焦点矩形,但是当控件获得焦点和这个价值属性为空,它会自动设置为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.

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

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

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