Equals Method
Collapse the table of content
Expand the table of content

DataGridCell.Equals Method (Object)

 

Gets a value indicating whether the DataGridCell is identical to a second DataGridCell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public override bool Equals(
	object o
)

Parameters

o
Type: System.Object

An object you are to comparing.

Return Value

Type: System.Boolean

true if the second object is identical to the first; otherwise, false.

The following example compares two DataGridCell objects.

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft