How would I go about aligning my text to the right side using DrawString.
I want to have it look like this
______1 st
instead of
1______ st
note:
"st" is from a second drawstring
_ is used as placeholder for empty space, not existing in the project
If I use String.Format to add placeholders in front of the number it gets spaced correctly but I don't want the placeholders in front of it, When I tried it with the #
in string format it simply placed it back to the left side.
So how would I go about placing the text on the right side?
What i've tried so far:
//the drawsting with 0 placeholders (gets the number on the right place but I want to remove the extra 0's)
e.Graphics.DrawString(String.Format("{0:0000000}", Convert.ToInt32(printAANT[itemsPrinted])), DefaultFont, Brushes.Black, distance, currentY);
//this just sets it to the left again
e.Graphics.DrawString(String.Format("{0:######0}", Convert.ToInt32(printAANT[itemsPrinted])), DefaultFont, Brushes.Black, distance, currentY);
And padLeft or using the format {0,-12:0} would both place the text more to the right and then draw the string on top of the "st".