comboBox.LabelField appears to be a String and there is no textWidth property of a string.
So I'm not sure how I would use your proposed solution?
I wish to examine all of the items in the dropDownList and extract the widths of the strings in each.
I am then going to resize the comboBox to fit the longest item in the list.
Unless anyone has any better ideas.
Well.... erm... textField.
How? That's quite cryptic... The spark ComboBox class doesn't have a textField property... or does it?
With all due respect, I'm not sure that's really responding much to my original question and if it is, I have no idea what your advice is supposed to mean. Perhaps I need to be clearer with my question next time.
You're telling me that spark has textInput. Do you mean that the ComboBox component has a textInput element? If so, how does that help me measure the width of the widest item in the ComboBox DropDownList? My current wish is to examine each item in the ComboBox component and determine which one has the widest label text (textWidth?) and how wide that label is.
Your advice regarding textWidth was interesting but I'm not sure how I can access that relevant element of the combobox component, in order to measure it.
Many thanks for your input.
I actually missed your point..
Yes I remember doing the same thing for fitting the combo to the max length of the drop-down list - looping through and getting the max value.
If anyone can help me out with this, I'd be grateful.
I have so much work on here that I have to just pass on achieveing this and get on with everything else *yikes* but I'll be coming back to it, so clear advice would be very helpful to me and dearly appreciated.
There is no measureText equivalent in Spark. MeasureText might work if you
use the MXFTEText.css option, but I think we updated the doc to recommend
that you hide a Label somewhere and stuff values into it, call validateNow()
and get its measurements.
Hi, Thanks for your reply. I popped a Label component alongside it (set the co-ordinates off stage) and measured it. Thanks.