Spread ASP.NET 6.0 Product Documentation
Merge(Object,Boolean) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > StyleInfo Class > Merge Method : Merge(Object,Boolean) Method


obj
Object whose style settings are merged with the current object
force
Whether to overwrite the current settings with the settings from the merge object
Set to True to overwrite the current settings.

Glossary Item Box

Merges style settings with the current object and has the option to force style settings from the merge object to overwrite settings 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 StyleInfo
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 style settings are merged with the current object
force
Whether to overwrite the current settings with the settings from the merge object
Set to True to overwrite the current settings.

Return Value

Boolean: true if merge is successful; false otherwise

Remarks

The Merge(Object, Boolean) method gives you the option to overwrite existing settings in the current object. If you set the fForce parameter to True, settings from the merge object overwrite settings in the current object. Set the fForce parameter to False if you do not want to overwrite settings in the current object.

If you do not need to overwrite the existing settings in the current object, you might want to use the Merge(Object) method.

Example

This example creates three objects, two StyleInfo objects and a SheetStyleProperty object. The ForeColor and Font properties of the first StyleInfo object are set, and the BackColor of the second. The second object is then merged with the first. Then a Boolean value returns whether the BackColor property has , in fact, been set after the merge.
C#Copy Code
 FarPoint.Web.Spread.StyleInfo info = new FarPoint.Web.Spread.StyleInfo();
 FarPoint.Web.Spread.StyleInfo minfo = new FarPoint.Web.Spread.StyleInfo();
 minfo.BackColor = Color.Yellow;
 info.ForeColor = Color.Red;
 info.Font.Bold = true;
 info.Merge(minfo, true);
 FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info);
 bool bol;
 bol = info.IsPropertySet(FarPoint.Web.Spread.SheetStyleProperty.BackColor);
 ListBox1.Items.Add(Convert.ToString(bol));
Visual BasicCopy Code
 Dim info As New FarPoint.Web.Spread.StyleInfo()
 Dim minfo As New FarPoint.Web.Spread.StyleInfo()
 Dim prop As FarPoint.Web.Spread.SheetStyleProperty
 minfo.BackColor = Color.Yellow
 info.ForeColor = Color.Red
 info.Font.Bold = True
 info.Merge(minfo, True)
 FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info)
 Dim bol As Boolean
 bol = info.IsPropertySet(prop.BackColor)
 ListBox1.Items.Add(bol)

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.