Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / SheetView Class / GetCellFromTag Method
Cell object in Cells collection from which to start (pass null to start from beginning)
Tag object to identify the cell you are looking for
Example


In This Topic
    GetCellFromTag Method
    In This Topic
    Gets a cell with a specific tag on the sheet.
    Syntax
    'Declaration
     
    Public Function GetCellFromTag( _
       ByVal cellToStart As Cell, _
       ByVal tagToFind As Object _
    ) As Cell
    'Usage
     
    Dim instance As SheetView
    Dim cellToStart As Cell
    Dim tagToFind As Object
    Dim value As Cell
     
    value = instance.GetCellFromTag(cellToStart, tagToFind)
    public Cell GetCellFromTag( 
       Cell cellToStart,
       object tagToFind
    )

    Parameters

    cellToStart
    Cell object in Cells collection from which to start (pass null to start from beginning)
    tagToFind
    Tag object to identify the cell you are looking for

    Return Value

    Cell object containing the cell with the specified tag, or null if no cell is found
    Remarks
    The object that is passed in to the method as the starting point is excluded from the search. The search includes all the objects after that one. So to start from the beginning, at index of zero, pass in null as the starting point.

    Example
    This example gets a cell with a specific tag on the sheet.
    FarPoint.Win.Spread.SheetView sv;
    FarPoint.Win.Spread.Cell acell;
    sv = fpSpread1.ActiveSheet;
    sv.Cells[2, 2].Tag = "MyTag";
    acell = sv.GetCellFromTag(null, "MyTag");
    MessageBox.Show("The tag is in cell " + acell.Row.ToString() + " ," + acell.Column.ToString());
    
    Dim sv As FarPoint.Win.Spread.SheetView
    Dim acell As FarPoint.Win.Spread.Cell
    sv = FpSpread1.ActiveSheet
    sv.Cells(2, 2).Tag = "MyTag"
    acell = sv.GetCellFromTag(Nothing, "MyTag")
    MessageBox.Show("The tag is in cell " & acell.Row.ToString() & " ," & acell.Column.ToString())
    See Also