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


info
StyleInfo object to compare to current StyleInfo object

Glossary Item Box

Compares a StyleInfo object's appearance with the current object's appearance.

Syntax

Visual Basic (Declaration) 
Public Function SameAppearance( _
   ByVal info As StyleInfo _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As StyleInfo
Dim info As StyleInfo
Dim value As Boolean
 
value = instance.SameAppearance(info)
C# 
public bool SameAppearance( 
   StyleInfo info
)

Parameters

info
StyleInfo object to compare to current StyleInfo object

Return Value

Boolean: true if appearance is identical; false otherwise

Remarks

The SameAppearance method compares the appearance settings of two StyleInfo objects.

The method compares the following appearance settings:

  • BackColor
  • ForeColor
  • Font
  • HorizontalAlign
  • VerticalAlign
  • Margin
  • Border

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 and, also, whether the two StyleInfo objects properties are all identical.
C#Copy Code
 FarPoint.Web.Spread.StyleInfo info = new FarPoint.Web.Spread.StyleInfo();
 FarPoint.Web.Spread.StyleInfo minfo = new FarPoint.Web.Spread.StyleInfo();
 FarPoint.Web.Spread.SheetStyleProperty prop;
 minfo.BackColor = Color.Yellow;
 info.ForeColor = Color.Red;
 info.Font.Bold = true;
 info.Merge(minfo);
 FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info);
 bool bol, boll;
 bol = info.IsPropertySet(FarPoint.Web.Spread.SheetStyleProperty.BackColor);
 boll = info.SameAppearance(minfo);
 ListBox1.Items.Add(Convert.ToString(bol));
 ListBox1.Items.Add(Convert.ToString(boll));
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)
 FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info)
 Dim bol, boll As Boolean
 bol = info.IsPropertySet(prop.BackColor)
 boll = info.SameAppearance(minfo)
 ListBox1.Items.Add(bol)
 ListBox1.Items.Add(boll) 

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.