ComboBox width based on longest item
3 answers
Depends. Are you using ASP.NET or Windows Forms or WPF? Are you using a fixed or proportional font?
If you are using Windows Forms, you will need to call MeasureString () to find out how much you need the text to be.
If you're using ASP.NET you can do something like MeasureString (), but you don't know exactly what font is displayed in the browser, so you can't just put it in your script.
+2
source to share