Spread Windows Forms 6.0 Product Documentation
ShowPrecedents Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : ShowPrecedents Method


sheetIndex
Index of the sheet
row
Index of the row
column
Index of the column

Glossary Item Box

Shows the cells that are referred to by formulas in other cells.

Syntax

Visual Basic (Declaration) 
Public Sub ShowPrecedents( _
   ByVal sheetIndex As Integer, _
   ByVal row As Integer, _
   ByVal column As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim sheetIndex As Integer
Dim row As Integer
Dim column As Integer
 
instance.ShowPrecedents(sheetIndex, row, column)
C# 
public void ShowPrecedents( 
   int sheetIndex,
   int row,
   int column
)

Parameters

sheetIndex
Index of the sheet
row
Index of the row
column
Index of the column

Remarks

The method shows which cell (indicated by the row and column parameters) this cell references. This method requires the formula text box control.

Example

This example shows the cells that this formula cell references.  The formula text box requires a license entry in the licenses.licx file.
C#Copy Code
 private void Form1_Load(object sender, EventArgs e)
        {
             fpSpread1.Sheets[0].Cells[0, 0, 5, 5].CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
        fpSpread1.Sheets[0].Cells[0, 0].Formula = "B2+B3";
        fpSpread1.Sheets[0].Cells[0, 3].Formula = "A1";
        fpSpread1.Sheets[0].Cells[0, 4].Formula = "D1";

        FarPoint.Win.Spread.FormulaTextBox editor = new FarPoint.Win.Spread.FormulaTextBox();
        editor.Location = new Point(0, 0);
        editor.Size = new Size(80, 20);
        Controls.Add(editor);
        editor.Attach(fpSpread1);           
          
        }

private void button1_Click(object sender, EventArgs e)
        {
             fpSpread1.ShowDependents(0, 0, 0);
             fpSpread1.ShowPrecedents(0, 0, 4);           
        
        }
Visual BasicCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        FpSpread1.Sheets(0).Cells(0, 0, 5, 5).CellType = New FarPoint.Win.Spread.CellType.NumberCellType()
        FpSpread1.Sheets(0).Cells(0, 0).Formula = "B2+B3"
        FpSpread1.Sheets(0).Cells(0, 3).Formula = "A1"
        FpSpread1.Sheets(0).Cells(0, 4).Formula = "D1"

        Dim editor As New FarPoint.Win.Spread.FormulaTextBox
        editor.Location = New Point(0, 0)
        editor.Size = New Size(80, 20)
        Controls.Add(editor)
        editor.Attach(FpSpread1)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        
        FpSpread1.ShowDependents(0, 0, 0)
        FpSpread1.ShowPrecedents(0, 0, 4)
End Sub

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.