I was just recently working with the DateField component and much to my surprise, the typical styles that can be applied to a core Text component are not available by default. The work around is to extend the DateField class and include the [Style] tags of the BorderStyles class. Unfortunately you just can’t include the entire BorderStlyes class. If you do, Flex throws the error: “[Style] must annotate a class.” To get around this minor annoyance you simply copy all the [Style] tags inline of your extended DateField class.
import mx.controls.DateField;
[Style(name="backgroundAlpha", type="Number", inherit="no")]
[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
[Style(name="backgroundDisabledColor", type="uint", format="Color", inherit="yes")]
[Style(name="backgroundImage", type="Object", format="File", inherit="no")]
[Style(name="backgroundSize", type="String", inherit="no")]
[Style(name="borderColor", type="uint", format="Color", inherit="no")]
[Style(name="borderSides", type="String", inherit="no")]
[Style(name="borderSkin", type="Class", inherit="no")]
[Style(name="borderStyle", type="String", enumeration="inset,outset,solid,none", inherit="no")]
[Style(name="borderThickness", type="Number", format="Length", inherit="no")]
[Style(name="cornerRadius", type="Number", format="Length", inherit="no")]
[Style(name="dropShadowEnabled", type="Boolean", inherit="no")]
[Style(name="dropShadowColor", type="uint", format="Color", inherit="yes")]
[Style(name="shadowDirection", type="String", enumeration="left,center,right", inherit="no")]
[Style(name="shadowDistance", type="Number", format="Length", inherit="no")]
public class CustomDateField extends DateField {
public function CustomDateField() {
super();
}
}
}