DataGrid.HitTestInfo.Nowhere Pole

Definicja

Wskazuje, że współrzędna odpowiada części kontrolki DataGrid , która nie działa.

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 

Wartość pola

Przykłady

Poniższy przykład sprawdza, czy użytkownik klika obszar siatki, który jest nieprawidłowy.

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

Uwagi

Inne części elementu System.Windows.Forms.DataGrid, takie jak Caption, mogą zwracać przydatne informacje. Jeśli część siatki nie ma funkcji (na przykład szarego obszaru za słabo wypełniona tabela siatki), Nowhere pole jest zwracane.

Dotyczy

Zobacz też