Spread for ASP.NET 7.0 Product Documentation
HorizontalAlign Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > Appearance Class : HorizontalAlign Property


Glossary Item Box

Gets or sets the horizontal alignment of an object or text.

Syntax

Visual Basic (Declaration) 
Public Property HorizontalAlign As HorizontalAlign
Visual Basic (Usage)Copy Code
Dim instance As Appearance
Dim value As HorizontalAlign
 
instance.HorizontalAlign = value
 
value = instance.HorizontalAlign
C# 
public HorizontalAlign HorizontalAlign {get; set;}

Property Value

HorizontalAlign object containing the alignment of text

Remarks

Valid values for this property are the horizontal alignment settings listed in the HorizontalAlign enumeration in the Microsoft .NET Framework Reference.

Use the VerticalAlign property to specify the vertical alignment of the object or text.

Example

This example creates a new Appearance object, sets the several properties such as color and alignment, then applies those settings to an instance of a Cell object.
C#Copy Code
FarPoint.Web.Spread.Appearance appr = 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;
acell = FpSpread1.Cells[0,0];
acell.BackColor = appr.BackColor;
acell.ForeColor = appr.ForeColor;
acell.Font.Bold = appr.Font.Bold;
acell.HorizontalAlign = appr.HorizontalAlign;
acell.VerticalAlign = appr.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()
appr.BackColor = Color.Red
appr.ForeColor = Color.White
appr.Font.Bold = True
appr.HorizontalAlign = HorizontalAlign.Right
appr.VerticalAlign = VerticalAlign.Top
Dim acell As FarPoint.Web.Spread.Cell
acell = FpSpread1.Cells(0, 0)
acell.BackColor = appr.BackColor
acell.ForeColor = appr.ForeColor
acell.Font.Bold = appr.Font.Bold
acell.HorizontalAlign = appr.HorizontalAlign
acell.VerticalAlign = appr.VerticalAlign
FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test")
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.