DataGrid.HitTestInfo 클래스

정의

지정한 좌표에 있는 DataGrid의 부분에 대한 정보가 들어 있습니다. 이 클래스는 상속될 수 없습니다.

public: ref class DataGrid::HitTestInfo sealed
public sealed class DataGrid.HitTestInfo
type DataGrid.HitTestInfo = class
Public NotInheritable Class DataGrid.HitTestInfo
상속
DataGrid.HitTestInfo

예제

다음 예제에서는 합니다 HitTest 에서 메서드를 MouseDown 반환할 이벤트는 DataGrid.HitTestInfo 개체입니다. 그런 다음 행, 열 및 표의 부분 인쇄 됩니다.

private:
   void dataGrid1_MouseDown( Object^ /*sender*/, System::Windows::Forms::MouseEventArgs^ e )
   {
      Console::WriteLine();
      System::Windows::Forms::DataGrid::HitTestInfo^ myHitTest;
      // Use the DataGrid control's HitTest method with the x and y properties.
      myHitTest = dataGrid1->HitTest( e->X, e->Y );
      Console::WriteLine( myHitTest );
      Console::WriteLine( "Column {0}", myHitTest->Column );
      Console::WriteLine( "Row {0}", myHitTest->Row );
      Console::WriteLine( "Type {0}", myHitTest->Type );
      Console::WriteLine( "ToString {0}", myHitTest );
      Console::WriteLine( "Hit {0}", myHitTest->Type );
   }
private void dataGrid1_MouseDown
(object sender, System.Windows.Forms.MouseEventArgs e)
{
   Console.WriteLine();
   System.Windows.Forms.DataGrid.HitTestInfo myHitTest;
   // Use the DataGrid control's HitTest method with the x and y properties.
   myHitTest = dataGrid1.HitTest(e.X,e.Y);
   Console.WriteLine(myHitTest);
   Console.WriteLine("Column " + myHitTest.Column);
   Console.WriteLine("Row " + myHitTest.Row);
   Console.WriteLine("Type " + myHitTest.Type);
   Console.WriteLine("ToString " + myHitTest.ToString());
   Console.WriteLine("Hit " + myHitTest.Type.ToString());
}
Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
    Console.WriteLine()
    Dim myHitTest As DataGrid.HitTestInfo
    ' Use the DataGrid control's HitTest method with the x and y properties.
    myHitTest = DataGrid1.HitTest(e.X, e.Y)
    Console.WriteLine("Column " & myHitTest.Column)
    Console.WriteLine("Row " & myHitTest.Row)
    Console.WriteLine("Type " & myHitTest.Type)
    Console.WriteLine("ToString " & myHitTest.ToString)
    Console.WriteLine("Format " & myHitTest.Type.ToString)
End Sub

설명

DataGrid.HitTestInfo 클래스와 함께 HitTest 메서드의 DataGrid 제어의 어느 부분을 결정 하는 데 사용 되는 DataGrid 컨트롤 사용자가 클릭 합니다. DataGrid.HitTestInfo 행, 열 및 표의 클릭 된 부분 클래스에 포함 되어 있습니다. 참조를 DataGrid.HitTestType 반환한 열거형을 Type 목록은 한 그리드 부분에 대 한 속성입니다.

반환할를 DataGrid.HitTestInfo를 호출 합니다 HitTest 메서드에서 MouseDown 이벤트를 DataGrid 컨트롤. 전달를 xy 의 속성을 MouseEventArgsHitTest 메서드.

필드

Nowhere

DataGrid 컨트롤의 작동하지 않는 부분에 해당하는 좌표임을 나타냅니다.

속성

Column

사용자가 클릭한 열의 번호를 가져옵니다.

Row

사용자가 클릭한 행의 번호를 가져옵니다.

Type

행 또는 열을 제외하고, DataGrid 컨트롤의 클릭된 부분을 가져옵니다.

메서드

Equals(Object)

두 개의 개체가 동일한지 여부를 나타냅니다.

GetHashCode()

DataGrid.HitTestInfo 인스턴스의 해시 코드를 가져옵니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

형식, 행 번호 및 열 번호를 가져옵니다.

적용 대상

추가 정보