ComboBox text formatting via AS3

I am developing an AIR application, and I need to change the font size of the text that appears in the dropDown list, as well as the main text in the combo box. My ComboBox is quite large, but the text displayed in it is very small. I tried using the setStyle method by passing a TextFormat to it, for example:

cmbEmployee.setStyle("textFormat", txtform); 

but it didn’t work. Although the same method works well with TextField.

Can anyone help?

+4
source share
1 answer

ComboBox is a container that contains the textField component and dropdown . You need to apply the β€œstyles” to specific components inside the ComboBox:

 // Text Formats that needs to be applied on your comboBox var txtformat:TextFormat = new TextFormat(); txtformat.size = 30; // Lets just increase the size of fonts // Increase the main TextField font size of your ComboBox yourComboBox.textField.setStyle("textFormat", txtformat); // Increase the font size to the dropdown component yourComboBox.dropdown.setRendererStyle("textFormat", txtformat); 
+7
source

All Articles