Changing the Flex DateChooser control’s text alignment

The following example shows how you can change the text alignment in the Flex DateChooser control by setting the textAlign style.

Full code after the jump.


<?xml version="1.0" encoding="utf-8"?>
<!-- -->
<mx:Application xmlns:mx=""

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="textAlign:">
                <mx:ComboBox id="comboBox" selectedIndex="1">
                            <mx:Object label="left" />
                            <mx:Object label="center" />
                            <mx:Object label="right" />

    <mx:DateChooser id="dateChooser"
            textAlign="{comboBox.selectedItem.label}" />


View source is enabled in the following example.

For an example of aligning the month name and year, see “Aligning headers in a DateChooser control in Flex”.

3 thoughts on “Changing the Flex DateChooser control’s text alignment

  1. Hi Peter,

    I have set the width and height for the dateChooser component. The texts are all aligned to top middle.

    Is there a way to align to align in the center.

    I have used a custom dateChooser. Which implements IUITextField. But do no where / how to set the alignment of the text to vertical middle.

    The demo link is here. With viewsource enabled. Could you pls help me.


Comments are closed.