DataGridCell.Equals(Object) 方法

定义

获取一个值,该值指示这 DataGridCell 是否与第二 DataGridCell个值相同。

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

参数

o
Object

要比较的对象。

返回

true 如果第二个对象与第一个对象相同,则为否则,为 false.

示例

以下示例比较两个 DataGridCell 对象。

Private Sub CompareCells()
    Dim currCell As DataGridCell
    Dim cell2 As DataGridCell
 
    currCell = DataGrid1.CurrentCell
    cell2.ColumnNumber = 0
    cell2.ColumnNumber = 0
    ' This won't return true until you select row 0, column 0.
    Console.WriteLine(currCell.Equals(cell2))
 End Sub

适用于