Click here to Skip to main content
13,050,614 members (91,806 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hello guys,

i am stored product price value in ms access text format. Now i am going to print all product name and price using print document but in my result price not correct order

for example

Computer          45000.00
mouse             250.00
keyboard          300.00
computer table    1500.00

but i want the following order

computer          45000.00
mouse               250.00
keyboard            300.00
computer table     1500.00

i want to match digits position (example one's position, ten's postion equal to each other product price). can any one tell the g.grawstring() function to align product price as above mention order.i hope any one help me.

sorry my english because i am not english man


[edit]Code blocks added - OriginalGriff[/edit]
Posted 22-Nov-12 2:25am
Updated 22-Nov-12 3:03am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You will have to use two DrawStrings: one for the label ("computer table") and one for the price ("1500.00")

You can then use the same rectangle:
RectangleF rect = new RectangleF(10.0F, 10.0F, 200.0F, 30.0F);
StringFormat format = new StringFormat(StringFormatFlags.DirectionRightToLeft);
g.DrawString("Computer table", font, brush, rect);
g.DrawString("1500.00", font, brush, rect, format);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100