Spread Silverlight Documentation
HorizontalAlignment Property (StyleInfo)
Example 


Gets or sets the horizontal alignment of the cell contents.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property HorizontalAlignment As CellHorizontalAlignment
'Usage
 
Dim instance As StyleInfo
Dim value As CellHorizontalAlignment
 
instance.HorizontalAlignment = value
 
value = instance.HorizontalAlignment
[System.ComponentModel.DefaultValue()]
public CellHorizontalAlignment HorizontalAlignment {get; set;}

Property Value

A CellHorizontalAlignment object that specifies the horizontal alignment for the cell. The default value is General.
Example
This example sets the HorizontalAlignment property.
GrapeCity.Windows.SpreadSheet.Data.StyleInfo aaa = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
aaa.Background = New SolidColorBrush(Colors.Aquamarine);
aaa.Parent = "ParentStyle";
aaa.Name = "aaa";
GrapeCity.Windows.SpreadSheet.Data.StyleInfo ParentStyle = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
ParentStyle.Background = new SolidColorBrush(Colors.Aquamarine);
ParentStyle.HorizontalAlignment = GrapeCity.Windows.SpreadSheet.Data.CellHorizontalAlignment.Right;
ParentStyle.Name = "ParentStyle";
gcSpreadSheet1.Sheets[0].NamedStyles.Add(aaa);
gcSpreadSheet1.Sheets[0].NamedStyles.Add(ParentStyle);
gcSpreadSheet1.Sheets[0].Cells[0, 0].StyleName = "aaa";
GcSpreadSheet1.Invalidate();
Dim aaa As New GrapeCity.Windows.SpreadSheet.Data.StyleInfo()
aaa.Background = New SolidColorBrush(Colors.Aquamarine)
aaa.Parent = "ParentStyle"
aaa.Name = "aaa"
Dim ParentStyle As New GrapeCity.Windows.SpreadSheet.Data.StyleInfo()
ParentStyle.Background = New SolidColorBrush(Colors.Aquamarine)
ParentStyle.HorizontalAlignment = GrapeCity.Windows.SpreadSheet.Data.CellHorizontalAlignment.Right
ParentStyle.Name = "ParentStyle"
GcSpreadSheet1.Sheets(0).NamedStyles.Add(aaa)
GcSpreadSheet1.Sheets(0).NamedStyles.Add(ParentStyle)
GcSpreadSheet1.Sheets(0).Cells(0, 0).StyleName = "aaa"
GcSpreadSheet1.Invalidate()
Requirements

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

See Also

Reference

StyleInfo Class
StyleInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.