Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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
 
Thanks
 
[edit]Code blocks added - OriginalGriff[/edit]
Posted 22-Nov-12 2:25am
Edited 22-Nov-12 3:03am
v2

1 solution

Rate this: bad
good
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);
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,651
1 Sergey Alexandrovich Kryukov 6,400
2 CPallini 5,230
3 George Jonsson 3,574
4 Gihan Liyanage 2,542


Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
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