المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Text formatting



C# Programming
06-11-2009, 11:40 PM
I'm trying to add spacing to the beginning of some text so that I can put small symbols before specific lines of text. The size of the symbols is always the same, 10x10 pixels, however the number of symbols can range from none to half a dozen.

The problem I'm running in to is figuring out the number of spaces to indent the text. Normally I'd simply move the bounding box over by the size of the bullets, but in this case, the next line of text needs to wrap under the graphics I'm inserting, so moving the bounding box cuts down on the space available for text.

Right now I'm just adding in 3 * the number of spaces as there are symbols in hopes of getting close, but it's a bit off. I've tried using MeasureString to get the size of a space, then adding enough spaces to move the text, but it comes out too little with only 1 symbol and not nearly enough by the time there are 4 or more symbols.

Any suggestions?

The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.