DataGrid.HitTestInfo.GetHashCode 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 DataGrid.HitTestInfo 執行個體的雜湊程式碼。
public:
override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer
傳回
這個執行個體的雜湊碼。
範例
下列範例會列印 的 DataGrid.HitTestInfo 雜湊碼。
private:
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 {0}", myHitTest->GetHashCode() );
}
private 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());
}
Private Sub dataGrid1_MouseDown(ByVal sender As Object, ByVal 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
備註
這個方法會覆寫 GetHashCode。