Spread Windows Forms 7.0 Product Documentation
TextAlign Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > ButtonCellType Class : TextAlign Property


Glossary Item Box

Gets or sets how the text aligns itself in relation to the button image.

Syntax

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

Property Value

ButtonTextAlign setting that determines the aligment of text

Example

This example sets up a cell in the first sheet as a two-state button cell (so each time the user clicks on it, it toggles) with the Picture image displayed in one state and PictureDown image displayed in the other state. The text is displayed above the image in the button.
C#Copy Code
FarPoint.Win.Spread.CellType.ButtonCellType butncell = new FarPoint.Win.Spread.CellType.ButtonCellType();
butncell.TwoState = true;
Image upimage;
Image dnimage;
upimage = Image.FromFile("..\\images\\up.jpg");
dnimage = Image.FromFile("..\\images\\down.jpg");
butncell.Picture = upimage;
butncell.PictureDown = dnimage;
butncell.TextAlign = FarPoint.Win.ButtonTextAlign.TextTopPictBottom;
butncell.Text = "Now up - Click";
butncell.TextDown ="Now down - Click";
fpSpread1.Sheets[0].Cells[4,2].CellType = butncell;
Visual BasicCopy Code
Dim butncell As New FarPoint.Win.Spread.CellType.ButtonCellType()
butncell.TwoState = True
Dim upimage As Image
Dim dnimage As Image
butncell.Picture = upimage.FromFile("..\images\up.jpg")
butncell.PictureDown = dnimage.FromFile("..\images\down.jpg")
butncell.TextAlign = FarPoint.Win.ButtonTextAlign.TextTopPictBottom
butncell.Text = "Now up - Click"
butncell.TextDown ="Now down - Click"
fpSpread1.Sheets(0).Cells(4,2).CellType = butncell

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.