Spread Windows Forms 15.0
Spread Windows Forms 15.0 Product Documentation / Developer's Guide / Spreadsheet Objects / Working with Scroll Bars / Customizing the Position in the Display
In This Topic
    Customizing the Position in the Display
    In This Topic

    You can customize the position of the data area of the spreadsheet in the display by choosing a row, column, or cell, and moving it to a particular position in the displayed portion of the spreadsheet in the Spread component.

    Use the ShowRow, ShowColumn, ShowCell, or ShowActiveCell methods in the FpSpread class, and the HorizontalPosition and VerticalPosition enumerations. These methods scroll the display until the specified item is displayed in the specified location.

    Using Code

    Set the ShowActiveCell method.

    Example

    This example sets the active cell and then displays the cell in the top, center of the spreadsheet.

    C#
    Copy Code
    fpSpread1.Sheets[0].SetActiveCell(3,4);
    fpSpread1.ShowActiveCell(FarPoint.Win.Spread.VerticalPosition.Top, FarPoint.Win.Spread.HorizontalPosition.Center);
    
    VB
    Copy Code
    fpSpread1.Sheets(0).SetActiveCell(3,4)
    fpSpread1.ShowActiveCell(FarPoint.Win.Spread.VerticalPosition.Top, FarPoint.Win.Spread.HorizontalPosition.Center)
    
    See Also