DataGrid.HitTestInfo.Equals(Object) DataGrid.HitTestInfo.Equals(Object) DataGrid.HitTestInfo.Equals(Object) DataGrid.HitTestInfo.Equals(Object) Method

定义

指示两个对象是否相同。Indicates whether two objects are identical.

public:
 override bool Equals(System::Object ^ value);
public override bool Equals (object value);
override this.Equals : obj -> bool
Public Overrides Function Equals (value As Object) As Boolean

参数

value
Object Object Object Object

要比较的第二个对象,类型为 ObjectThe second object to compare, typed as Object.

返回

如果对象相同,则为 true;否则为 falsetrue if the objects are equal; otherwise, false.

示例

下面的示例测试用户是否在单击无效网格区域。The following example tests whether the user is clicking an area of the grid that is not valid.

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

适用于

另请参阅