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


appearance
Appearance object to receive the appearance settings
force
Set to True to replace all settings, including existing settings, in the Appearance object with settings from this StyleInfo object. Set to False to only copy in settings from this object when there are not corresponding settings in the Appearance object.

Glossary Item Box

Gets the appearance settings for the StyleInfo object, with the option to specify whether all settings are copied into the specified Appearance object.

Syntax

Visual Basic (Declaration) 
Public Overloads Function GetAppearance( _
   ByVal appearance As Appearance, _
   ByVal force As Boolean _
) As Appearance
Visual Basic (Usage)Copy Code
Dim instance As StyleInfo
Dim appearance As Appearance
Dim force As Boolean
Dim value As Appearance
 
value = instance.GetAppearance(appearance, force)
C# 
public Appearance GetAppearance( 
   Appearance appearance,
   bool force
)

Parameters

appearance
Appearance object to receive the appearance settings
force
Set to True to replace all settings, including existing settings, in the Appearance object with settings from this StyleInfo object. Set to False to only copy in settings from this object when there are not corresponding settings in the Appearance object.

Return Value

Appearance object containing the updated appearance settings

Remarks

Set force to true to replace all settings, including existing settings, in the Appearance object with settings from this StyleInfo object. Set force to false to copy in only the settings from this object when there are not corresponding settings in the Appearance object.

Example

This example creates an Appearance object and two StyleInfo objects. The cinfo object passes its settings into the Appearance object, which is then used to adjust the settings for the info objects properties. That, in turn, is used to set the style for the spreadsheet.
C#Copy Code
FarPoint.Web.Spread.Appearance appr = new FarPoint.Web.Spread.Appearance();
FarPoint.Web.Spread.StyleInfo info = new FarPoint.Web.Spread.StyleInfo();
FarPoint.Web.Spread.StyleInfo cinfo = new FarPoint.Web.Spread.StyleInfo();
cinfo.BackColor = Color.Red;
cinfo.ForeColor = Color.White;
cinfo.HorizontalAlign = HorizontalAlign.Right;
cinfo.GetAppearance(appr);
info.BackColor = appr.BackColor;
info.ForeColor = appr.ForeColor;
info.HorizontalAlign = appr.HorizontalAlign;
FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info);
FpSpread1.ActiveSheetView.SetValue(0, 0, "StyleInfo");
FpSpread1.Columns[0].Width = 150;
FpSpread1.Rows[0].Height = 60; 
Visual BasicCopy Code
Dim appr As New FarPoint.Web.Spread.Appearance()
Dim info As New FarPoint.Web.Spread.StyleInfo()
Dim cinfo As New FarPoint.Web.Spread.StyleInfo()
cinfo.BackColor = Color.Red
cinfo.ForeColor = Color.White
cinfo.HorizontalAlign = HorizontalAlign.Right
cinfo.GetAppearance(appr, True)
info.BackColor = appr.BackColor
info.ForeColor = appr.ForeColor
info.HorizontalAlign = appr.HorizontalAlign
FpSpread1.ActiveSheetView.SetStyleInfo(0, 0, info)
FpSpread1.ActiveSheetView.SetValue(0, 0, "StyleInfo")
FpSpread1.Columns(0).Width = 150
FpSpread1.Rows(0).Height = 60 

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.