Spread ASP.NET 17
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / ListBoxCellType Class / SelectedForeColor Property
Example


In This Topic
    SelectedForeColor Property (ListBoxCellType)
    In This Topic
    Gets or sets the text color for the selected item in the list.
    Syntax
    'Declaration
     
    
    Public Property SelectedForeColor As Color
    'Usage
     
    
    Dim instance As ListBoxCellType
    Dim value As Color
     
    instance.SelectedForeColor = value
     
    value = instance.SelectedForeColor
    public Color SelectedForeColor {get; set;}

    Property Value

    Color object containing the text color for the selected item in the list
    Remarks
    This property is available at run time only.
    Example
    This example creates a ListBoxCellType Object and assigns it to the first cell in the sheet. An array of items for the list and the values for the corresponding items are supplied. The background and foreground colors of the selected item are defined and the value of the cell is set to the third item in the list.
    string[]lbstr;
    lbstr=new String[]{"Carbon","Oxygen","Hydrogen"};
    string[]strval;
    strval=new String[]{"1","2","3"};
    FarPoint.Web.Spread.ListBoxCellType lbcell=new FarPoint.Web.Spread.ListBoxCellType();
    lbcell.SelectedBackColor=Color.Yellow;
    lbcell.SelectedForeColor=Color.DarkBlue;
    lbcell.Items=lbstr;
    lbcell.Values=strval;
    FpSpread1.ActiveSheetView.Cells[0,0].CellType=lbcell;
    FpSpread1.ActiveSheetView.SetValue(0,0,"3");
    FpSpread1.ActiveSheetView.Rows[0].Height=140;
    Dim lbstr As String()
    lbstr=New String(){"Carbon","Oxygen","Hydrogen"}
    Dim strval As String()
    strval=New String(){"1","2","3"}
    Dim lbcell As New FarPoint.Web.Spread.ListBoxCellType(lbstr,strval)
    lbcell.SelectedBackColor=Color.Yellow
    lbcell.SelectedForeColor=Color.DarkBlue
    lbcell.Items=lbstr
    lbcell.Values=strval
    FpSpread1.ActiveSheetView.Cells(0,0).CellType=lbcell
    FpSpread1.ActiveSheetView.SetValue(0,0,"3")
    FpSpread1.ActiveSheetView.Rows(0).Height=140
    See Also