graphics.drawstring and string format

Draders
06-29-2004, 11:48 PM
I am making a custom listbox using GDI+ and am having issues with drawing a string in a formatted area. The following image shows what the problem is.

http://www.eikyojin.com/naa/drawstring.png

With StringTrimming.EllipsisCharacter (the "..." at the end of the word) turned on it does the weird spacings. If it were off and the string was long enough it won’t.

Another problem I am having is with the width of text. When I measure a string using Graphics.MeasureString it doesn’t add up to what’s showing on the screen as seen in this image (the green represents the area of the rectangle and 70 is the width)

http://www.eikyojin.com/naa/stringlength.png

Again there's strange spacing. It's almost like its trying to distribute the text evenly in the area. (ellipsis were off for the above image)

Any suggestions?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum