DataGrid.HitTestInfo.Nowhere DataGrid.HitTestInfo.Nowhere DataGrid.HitTestInfo.Nowhere DataGrid.HitTestInfo.Nowhere Field

定义

指示某个坐标与 DataGrid 控件的未正常运行部分相对应。Indicates that a coordinate corresponds to part of the DataGrid control that is not functioning.

public: static initonly System::Windows::Forms::DataGrid::HitTestInfo ^ Nowhere;
public static readonly System.Windows.Forms.DataGrid.HitTestInfo Nowhere;
 staticval mutable Nowhere : System.Windows.Forms.DataGrid.HitTestInfo
Public Shared ReadOnly Nowhere As DataGrid.HitTestInfo 

字段值

示例

下面的示例测试是否用户单击的不是有效的网格区域。The following example tests whether the user is clicking an area of the grid that is not valid.

private:
   void dataGrid1_MouseDown( Object^ /*sender*/,
     System::Windows::Forms::MouseEventArgs^ e )
   {
      if ( dataGrid1->HitTest( e->X, e->Y )->Equals(
         DataGrid::HitTestInfo::Nowhere ) )
      {
         Console::WriteLine( "Nowhere" );
      }
   }
private void dataGrid1_MouseDown
(object sender, System.Windows.Forms.MouseEventArgs e)
{
   if(dataGrid1.HitTest(e.X,e.Y).Equals (DataGrid.HitTestInfo.Nowhere)) 
   {
      Console.WriteLine("Nowhere");
   }
}
   
Private Sub dataGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
    If dataGrid1.HitTest(e.X, e.Y).Equals(DataGrid.HitTestInfo.Nowhere) Then
        Console.WriteLine("Nowhere")
    End If
End Sub 'dataGrid1_MouseDown

注解

其他部分System.Windows.Forms.DataGrid,如Caption,可以返回有用的信息。Other parts of the System.Windows.Forms.DataGrid, such as the Caption, can return useful information. 如果网格的一部分 (如后面的灰色区稀疏填充的网格表),有没有函数Nowhere返回字段。If the part of the grid has no function (such as the gray area behind a sparsely populated grid table), the Nowhere field is returned.

适用于

另请参阅