Recently, a developer posted a question to the VSTO forum asking us how to set the width of a drop down control by using the Ribbon Designer (http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/8965ae5a-9c02-4aec-9178-675650b7044e/).
As this person experienced, if you do not set the width of the control, the text that appears in a drop down, combo box, or edit box will truncate. For example, the string “I love Visual Studio Tools for Office!” is truncated in the following drop down:
So how do you fix this? The magic lies in the SizeString property. However, the use of this property is not so obvious. Instead of setting this property to a number such as 20 for 20 characters of space, you must type an actual character for each character’s worth of space you want to allocate for the text width.
For example, to make enough space for the string “I love Visual Studio Tools for Office!”, set the SizeString property of the drop down to “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” or “jlkjlkjlkjlkjdlslaledfoplklksjjklsfdf” etc.
You can also decrease the size of the text area to show fewer characters than appear by default. For example, just set SizeString to “xx” if you want only two characters to appear.