Problem with RibbonButton DropDown Width.

Apr 28, 2014 at 2:57 PM
I put an item into the the DropDownItems collection of a RibbonButton with DropDown Style, just like the following:


The text of the dropdown item is "111 222 333 444 555 666 777 888 999", but when it is shown, the last part is cut (in this example, the last "9" is not visible). It seems that the control does not calculate its size well (see the function MeasureSize in RibbonButton.cs), but i did not understand why! Can someone helps me?
Thank's a lot!
Jun 15, 2014 at 12:10 PM
That is quite tricky!

Though it is quite late, maybe the answer is still useful to you:
Someone mixed up 'Graphics' and 'TextRenderer' - which is one of the worst things you can do if you wanna draw and measure strings!
In the RibbonButton for drawing the Graphics object is used, while for measuring (to get the size of the button) the TextRenderer is used...

Painful... but let me check it out.
Jun 15, 2014 at 3:51 PM