To make sure that the text in listbox items is not truncated I want to adjust its width to the width of the item with longest text.
Is there any way to get a ‘actual’ width of the listbox item the one which is based on the item’s text.
ListBox.GetItemRectangle does not seem to be returning this actual width.
thank you.
MeasureString method: (copy pasted from msdn)
Add width of the textbox (left and right side) to the value