Spread ASP.NET 6.0 Product Documentation
Clone Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > Appearance Class : Clone Method


Glossary Item Box

Creates a new Appearance object that is a copy of the current instance.

Syntax

Visual Basic (Declaration) 
Public Overridable Function Clone() As Object
Visual Basic (Usage)Copy Code
Dim instance As Appearance
Dim value As Object
 
value = instance.Clone()
C# 
public virtual object Clone()

Return Value

Object containing a new copy of the Appearance object

Example

This example creates two Appearance objects and a Cell object. Several properties are set for the first Appearance object, and they are subsequently cloned to the second instance. The properties are then applied from the second Appearance object to the Cell objects corresponding properties.
C#Copy Code
FarPoint.Web.Spread.Appearance appr = New FarPoint.Web.Spread.Appearance();
FarPoint.Web.Spread.Appearance appr1 = New FarPoint.Web.Spread.Appearance();
FarPoint.Web.Spread.Cell acell;
appr.BackColor = Color.Red;
appr.ForeColor = Color.White;
appr.Font.Bold = True;
appr.HorizontalAlign = HorizontalAlign.Right;
appr.VerticalAlign = VerticalAlign.Top;
appr1 = appr.Clone();
acell = FpSpread1.Cells[0, 0];
acell.BackColor = appr1.BackColor;
acell.ForeColor = appr1.ForeColor;
acell.Font.Bold = appr1.Font.Bold;
acell.HorizontalAlign = appr1.HorizontalAlign;
acell.VerticalAlign = appr1.VerticalAlign;
FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test");
FpSpread1.Columns[0].Width = 150;
FpSpread1.Rows[0].Height = 60;
Visual BasicCopy Code
Dim appr As New FarPoint.Web.Spread.Appearance()
Dim appr1 As New FarPoint.Web.Spread.Appearance()
appr.BackColor = Color.Red
appr.ForeColor = Color.White
appr.Font.Bold = True
appr.HorizontalAlign = HorizontalAlign.Right
appr.VerticalAlign = VerticalAlign.Top
appr1 = appr.Clone()
Dim acell As FarPoint.Web.Spread.Cell
acell = FpSpread1.Cells(0, 0)
acell.BackColor = appr1.BackColor
acell.ForeColor = appr1.ForeColor
acell.Font.Bold = appr1.Font.Bold
acell.HorizontalAlign = appr1.HorizontalAlign
acell.VerticalAlign = appr1.VerticalAlign
FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test")
FpSpread1.Columns(0).Width = 150
FpSpread1.Rows(0).Height = 60

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.