共用方式為


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

要比較的物件。

傳回

Boolean

如果第二個物件與第一個物件相同,則為 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

適用於