I have a series of buttons that display filenames. If I set the Text property when the filename is wider than the number of pixels available the text "wraps" and instead if the text being displayed LeftMiddle it is displayed LeftTop. Therefore I only display as many characters as can be shown (using the PathCompactPathEx() method).
However - How can I tell how many pixels are available? My current approach is:
button.Width - button.Image.Width - button.Padding.Horizontal
This doesn't always work and sometimes the text still wraps.
Any clues as to what the correct way of determining the number of pixels available for text is?