Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Cell Types / Working with Graphical Cell Types / Setting a Progress Indicator Cell
In This Topic
    Setting a Progress Indicator Cell
    In This Topic

    A progress indicator cell displays a progress indicator control across the entire cell. You can specify the color of the fill, the text to display, the color of the text and other properties.

    Examples of Two Progress Indicator Cells

    To create a cell that acts like a progress indicator, use the ProgressCellType class. Create a progress indicator cell using the procedure described here.

    Customize the Indicator

    You can fill in the indicator with a solid color, by default, or with individual bars, as shown in this figure.

    Progress Indicator with Bars

    You can customize the display and operation of the progress indicator in the cell by setting the following properties.

    Property Description
    BackgroundImage Sets the background image for the cell.
    FillColor Sets the color to use for the filled part of the progress indicator.
    FillColor2 Sets the second fill color to use for the gradient part of the progress indicator.
    FillTextColor Sets the color to use for the text in the filled part of the indicator.
    GradientMode Sets the gradient mode for a gradient style progress indicator.
    Maximum Sets the maximum value for user entry.
    Minimum Sets the minimum value for user entry.
    Orientation Sets the orientation of the progress bar.
    Picture Sets the image to use for the progress bar when the style is set to Picture.
    ShowText Sets whether the percent filled string is displayed.
    Style Sets the style of the progress bar(s).
    Text Sets the string to use when TextStyle is set to Custom.
    TextStyle Sets how the text portion of the progress bar is displayed.

    With these properties, you can set the various aspects of the text, you can set a picture to display, and you can define the colors, even specifying two colors for a gradient from one color to another.

    Note that some graphical elements in certain cell types are affected by XP themes (visual styles). Setting the VisualStyles property of the Spread component to "off" can allow visual customizations of those graphical cell types to work as expected. For more information, refer to Using XP Themes with the Component.

    For more information on the properties and methods of this cell type, refer to the ProgressCellType class.

    Using the Properties Window

    1. At design time, in the Properties window, select the Spread component.
    2. Select the Sheets property.
    3. Click the button to display the SheetView Collection Editor.
    4. In the Members list, select the sheet in which the cells appear.
    5. In the property list, select the Cells property and then click the button to display the Cell, Column, and Row Editor.
    6. Select the cells for which you want to set the cell type.
    7. In the property list, select the CellType property and choose the Progress cell type.
    8. Expand the list of properties under the CellType property. Select and set these specific properties as needed.
    9. Click OK to close the Cell, Column, and Row Editor.
    10. Click OK to close the SheetView Collection Editor.

    Using Code

    1. Define the progress indicator cell by creating an instance of the ProgressCellType class.
    2. Format and specify the appearance of the progress indicator.
    3. Assign the progress indicator cell type to a cell or range of cells by setting the CellType property for a cell, column, row, or style to the ProgressCellType object.

    Example

    This example creates a progress cell.

    C#
    Copy Code
    FarPoint.Win.Spread.CellType.ProgressCellType progcell = new FarPoint.Win.Spread.CellType.ProgressCellType();
    progcell.FillColor = Color.Red;
    fpSpread1.ActiveSheet.Cells[0, 0].CellType = progcell;
    fpSpread1.ActiveSheet.Cells[0, 0].VisualStyles = FarPoint.Win.VisualStyles.Off;
    fpSpread1.ActiveSheet.Cells[0, 0].Value = 50;
    
    VB
    Copy Code
    Dim progcell As New FarPoint.Win.Spread.CellType.ProgressCellType()
    progcell.FillColor = Color.Red
    fpSpread1.ActiveSheet.Cells(0, 0).CellType = progcell
    fpSpread1.ActiveSheet.Cells(0, 0).VisualStyles = FarPoint.Win.VisualStyles.Off
    fpSpread1.ActiveSheet.Cells(0, 0).Value = 50\
    

    Using the Spread Designer

    1. Select the cell or cells in the work area.
    2. In the property list, in the Misc category, select CellType. From the drop-down list, choose the Progress cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Select and set those properties as needed.

      Or right-click on the cell or cells and select Cell Type. From the list, select Progress. In the CellType editor, set the properties you need. Click Apply.

    3. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.
    See Also