Skip to main content
Participant
November 23, 2009
Question

Change font size of ComboBox dropdown

  • November 23, 2009
  • 1 reply
  • 4048 views

How do I change the font/font-size of the dropdown in a ComboBox?

I know how to change the edit field but not the dropdown!

var textFormat:TextFormat = new TextFormat();

textFormat.font = "Trebuchet MS";

textFormat.size = 26;

combo.textField.setStyle("textFormat", textFormat);

combo.rowCount = 10;

This topic has been closed for replies.

1 reply

Participant
November 23, 2009

setRendererStyle solved it!

// add items to combobox

var dp:DataProvider = new DataProvider();

for each(var u:User in _userDb)

    dp.addItem({label:u._userName, data:u});

combo.dataProvider = dp;

var textFormat:TextFormat = new TextFormat();

textFormat.font = "Trebuchet MS";

textFormat.size = 26;

combo.textField.setStyle("textFormat", textFormat);

combo.rowCount = 10;

combo.dropdown.rowHeight = 40;

combo.dropdown.setRendererStyle("textFormat", textFormat);