Autosizing Combo Dropdown width (vs2005)
-
Hey all, anyone know if there's a quick easy way to autosize the width of the dropdown box, based on the items it lists? Or is there a way of finding the width of a string in pixels, so I could set the dropdown width with that value? Any ideas for a Monday morning? Mark -- modified at 5:33 Monday 19th February, 2007
-
Hey all, anyone know if there's a quick easy way to autosize the width of the dropdown box, based on the items it lists? Or is there a way of finding the width of a string in pixels, so I could set the dropdown width with that value? Any ideas for a Monday morning? Mark -- modified at 5:33 Monday 19th February, 2007
-
I just did a search in google and the first result link is http://www.vbrad.com/article.aspx?id=9[^]
-
That would be great if I was using VB6! I was hoping there was something abit simpler and more "managed" in .Net 2
I dont have the code right now but here is the suggestion for Googling. You cannot look at the length of the string itself you must look at the total character length of the values and keep the widest value and set that width value to the width of the combobox but add a little extra to include the width of the drop down arrow.
Cleako