DataGrid.HitTestInfo.Nowhere フィールド

定義

座標が、DataGrid コントロール内の機能を持たない部分に対応していることを示します。

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 

フィールド値

次の例では、ユーザーが無効なグリッドの領域をクリックしているかどうかをテストします。

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

注釈

の他の System.Windows.Forms.DataGrid部分 (など) は Caption、有用な情報を返すことができます。 グリッドの一部に関数がない場合 (スパースに設定されたグリッド テーブルの背後にある灰色の領域など) Nowhere 、フィールドが返されます。

適用対象

こちらもご覧ください