This topic has not yet been rated - Rate this topic

DataGrid.HitTestInfo.GetHashCode Method

Gets the hash code for the DataGrid.HitTestInfo instance.

[Visual Basic]
Overrides Public Function GetHashCode() As Integer
[C#]
public override int GetHashCode();
[C++]
public: int GetHashCode();
[JScript]
public override function GetHashCode() : int;

Return Value

The hash code for this instance.

Remarks

This method overrides GetHashCode.

Example

[Visual Basic, C#, C++] The following example prints the hash code of the DataGrid.HitTestInfo.

[Visual Basic] 
Protected Sub dataGrid1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs)
    Dim newLine As String = ControlChars.Cr
    Console.WriteLine(newLine)
    Dim myHitTest As System.Windows.Forms.DataGrid.HitTestInfo
    ' Use the DataGrid control's HitTest method with the x and y properties.
    myHitTest = dataGrid1.HitTest(e.X, e.Y)
    Console.WriteLine(("Hashcode " & myHitTest.GetHashCode().ToString()))
End Sub 'dataGrid1_MouseDown

[C#] 
protected void dataGrid1_MouseDown
(object sender, System.Windows.Forms.MouseEventArgs e)
{
   string newLine = "\n";
   Console.WriteLine(newLine);
   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("Hashcode " + myHitTest.GetHashCode().ToString());
}


[C++] 
protected:
void dataGrid1_MouseDown(Object* /*sender*/, System::Windows::Forms::MouseEventArgs* e)
{
   String* newLine = S"\n";
   Console::WriteLine(newLine);
   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(S"Hashcode {0}", __box(myHitTest->GetHashCode()));
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataGrid.HitTestInfo Class | DataGrid.HitTestInfo Members | System.Windows.Forms Namespace | DataGrid | DataGrid.HitTestType | HitTest

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.