Language

HorizontalAlign Enum

Definition

Specifies the horizontal alignment of items within a container.

public enum class HorizontalAlign
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.HorizontalAlignConverter))]
public enum HorizontalAlign
[]
type HorizontalAlign = 
Public Enum HorizontalAlign
Inheritance
HorizontalAlign
Attributes

Fields

Name Value Description
NotSet 0

The horizontal alignment is not set.

Left 1

The contents of a container are left justified.

Center 2

The contents of a container are centered.

Right 3

The contents of a container are right justified.

Justify 4

The contents of a container are uniformly spread out and aligned with both the left and right margins.

Examples

The following example shows how setting the HorizontalAlign property of a Panel control changes the horizontal alignment for the text of a Label control that is contained by the Panel control.

<%@ Page Language="C#"%>





 
    HorizontalAlign Example 
 
 
    

HorizontalAlign Example


Left Center Right Justify
<%@ Page Language="VB"%>





 
    HorizontalAlign Example 
 
 
    

HorizontalAlign Example


Left Center Right Justify

Remarks

The HorizontalAlign enumeration represents the horizontal alignment options for items within a container, such as a TableCell.

Applies to