Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / NamedStyle Class / CopyFrom Method
Object from which to copy style settings
Example


In This Topic
    CopyFrom Method (NamedStyle)
    In This Topic
    Copies the properties of the specified object to the current object.
    Syntax
    'Declaration
     
    Public Overrides Sub CopyFrom( _
       ByVal obj As Object _
    ) 
    'Usage
     
    Dim instance As NamedStyle
    Dim obj As Object
     
    instance.CopyFrom(obj)
    public override void CopyFrom( 
       object obj
    )

    Parameters

    obj
    Object from which to copy style settings
    Example
    This example copies a StyleInfo object into a NamedStyle object and uses it to set the background color of the sheet.
    FarPoint.Win.Spread.StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
    si.BackColor = Color.Yellow;
    si.Font = new Font("Comic Sans Serif", 12);
    FarPoint.Win.Spread.NamedStyle parent = new FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault");
    parent.CopyFrom(si);
    fpSpread1.NamedStyles.Add(parent);
    fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = parent;
    fpSpread1.ActiveSheet.RowHeader.DefaultStyle = parent;
    Dim si As New FarPoint.Win.Spread.StyleInfo()
    si.BackColor = Color.Yellow
    si.Font = New Font("Comic Sans Serif", 12)
    Dim parent As New FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault")
    parent.CopyFrom(si)
    FpSpread1.NamedStyles.Add(parent)
    FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = parent
    FpSpread1.ActiveSheet.RowHeader.DefaultStyle = parent
    See Also