DataGrid.HitTestInfo.Nowhere Pole

Definice

Označuje, že souřadnice odpovídá části DataGrid ovládacího prvku, který není funkční.

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 

Hodnota pole

Příklady

Následující příklad testuje, zda uživatel kliká na oblast mřížky, která není platná.

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

Poznámky

Další části , System.Windows.Forms.DataGridjako Captionje , mohou vrátit užitečné informace. Pokud část mřížky nemá žádnou funkci (například šedá oblast za řídce vyplněnou tabulkou mřížky), Nowhere vrátí se pole.

Platí pro

Viz také