Spread for ASP.NET 7.0 Product Documentation
Merge(Object,Boolean) Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > Appearance Class > Merge Method : Merge(Object,Boolean) Method


obj
Object whose appearance settings will be merged with the current object
force
Whether appearance settings are overridden in the current object

Glossary Item Box

Merges appearance settings of the specified object with the current object with the option to force a merge if the settings are defined in the current object.

Syntax

Visual Basic (Declaration) 
Public Overloads Overridable Function Merge( _
   ByVal obj As Object, _
   ByVal force As Boolean _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As Appearance
Dim obj As Object
Dim force As Boolean
Dim value As Boolean
 
value = instance.Merge(obj, force)
C# 
public virtual bool Merge( 
   object obj,
   bool force
)

Parameters

obj
Object whose appearance settings will be merged with the current object
force
Whether appearance settings are overridden in the current object

Return Value

Boolean: true if successful; false otherwise

Remarks

If you always want to restrict the merging of appearance settings to occur only if the settings are not defined in the current object, use the Merge(Object) method.

Example

This example creates two Appearance objects and a Cell object. Several properties are set for the first Appearance object, and they are subsequently merged into the second instance. The properties are then applied from the second Appearance object to the Cell objects corresponding properties. The BackColor property of the Appearance object is then queried to see if it has been defined, and the result is returned to a text box.
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.Merge(appr, true); 
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.Celss[0, 0].Text = "Appearance Test"; 
FpSpread1.Columns[0].Width = 150; 
FpSpread1.Rows[0].Height = 60; 
bool bl; 
bl = appr.IsDefined(FarPoint.Web.Spread.AppearanceProperty.BackColor); 
TextBox1.Text = Convert.ToString(bl); 
Visual BasicCopy Code
Dim appr As New FarPoint.Web.Spread.Appearance
Dim appr1 As New FarPoint.Web.Spread.Appearance
Dim acell As FarPoint.Web.Spread.Cell
Dim prop As FarPoint.Web.Spread.AppearanceProperty
Dim bl As Boolean
appr.BackColor = Color.Red
appr.ForeColor = Color.White
appr.Font.Bold = True
appr.HorizontalAlign = HorizontalAlign.Right
appr.VerticalAlign = VerticalAlign.Top
appr1.Merge(appr, True)
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.Cells(0, 0).Text = "Appearance Test"
FpSpread1.Columns(0).Width = 150
FpSpread1.Rows(0).Height = 60
bl = appr.IsDefined(prop.BackColor)
TextBox1.Text = bl

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.