DataGrid.HitTestInfo DataGrid.HitTestInfo DataGrid.HitTestInfo DataGrid.HitTestInfo Class

정의

지정한 좌표에 있는 DataGrid의 부분에 대한 정보가 들어 있습니다.Contains information about a part of the DataGrid at a specified coordinate. 이 클래스는 상속될 수 없습니다.This class cannot be inherited.

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

예제

다음 예제에서는 합니다 HitTest 에서 메서드를 MouseDown 반환할 이벤트는 DataGrid.HitTestInfo 개체입니다.The following example uses the HitTest method in a MouseDown event to return the DataGrid.HitTestInfo object. 그런 다음 행, 열 및 표의 부분 인쇄 됩니다.The row, column, and part of the grid are then printed.

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 컨트롤 사용자가 클릭 합니다.The DataGrid.HitTestInfo class, in conjunction with the HitTest method of the DataGrid control, is used to determine which part of a DataGrid control the user has clicked. DataGrid.HitTestInfo 행, 열 및 표의 클릭 된 부분 클래스에 포함 되어 있습니다.The DataGrid.HitTestInfo class contains the row, column, and part of the grid that was clicked. 참조를 DataGrid.HitTestType 반환한 열거형을 Type 목록은 한 그리드 부분에 대 한 속성입니다.See the DataGrid.HitTestType enumeration returned by the Type property for a complete list of grid parts.

반환할를 DataGrid.HitTestInfo를 호출 합니다 HitTest 메서드에서 MouseDown 이벤트를 DataGrid 컨트롤.To return a DataGrid.HitTestInfo, invoke the HitTest method from the MouseDown event of DataGrid control. 전달를 xy 의 속성을 MouseEventArgsHitTest 메서드.Pass the x and y properties of the MouseEventArgs to the HitTest method.

필드

Nowhere Nowhere Nowhere Nowhere

DataGrid 컨트롤의 작동하지 않는 부분에 해당하는 좌표임을 나타냅니다.Indicates that a coordinate corresponds to part of the DataGrid control that is not functioning.

속성

Column Column Column Column

사용자가 클릭한 열의 번호를 가져옵니다.Gets the number of the column the user has clicked.

Row Row Row Row

사용자가 클릭한 행의 번호를 가져옵니다.Gets the number of the row the user has clicked.

Type Type Type Type

행 또는 열을 제외하고, DataGrid 컨트롤의 클릭된 부분을 가져옵니다.Gets the part of the DataGrid control, other than the row or column, that was clicked.

메서드

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

두 개의 개체가 동일한지 여부를 나타냅니다.Indicates whether two objects are identical.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

DataGrid.HitTestInfo 인스턴스의 해시 코드를 가져옵니다.Gets the hash code for the DataGrid.HitTestInfo instance.

GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

형식, 행 번호 및 열 번호를 가져옵니다.Gets the type, row number, and column number.

적용 대상

추가 정보