Re: printer object alignment
You may set the currentx property of printer:
http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Re: printer object alignment
Another trick: store numbers in string variable of fixed lenght, aligned to right with format function. Then print the string variables.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Re: printer object alignment
As Cimperiali implied, you will have to use the CurrentX property. Then, in assosiation with the TextWidth, you can determine where to start. Note tha in the code I used Me instead of Printer, which results in the text being printed on the form.
Dim sWidth as Long
' compute point where it must be alligned, you can give this a fixed value if you want
sWidth = me.TextWidth("000000.00")
me.CurrentX = sWidth - me.TextWidth("1234.56")
me.print "1234.56"
me.CurrentX = sWidth - me.TextWidth("123.45")
me.print "123.45"
me.CurrentX = sWidth - me.TextWidth("12345.67")
me.print "12345.67"
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Re: printer object alignment
excellent, but I left one major issue ,a text preceeded the numbers
ie
vGross=123.45
vDiscount=23.45
vNett=100.00
printer.currentx = sWidth - printer.textwidth(vGross)
printer.print "Gross : " & vGross
printe.currentx=swidth - printer.textwidht(vDiscount)
printer.print "Discounts : " & vDiscount
printer.print " ----------------- "
printer.currentx=swidth - printer.textwidht(vNett)
printer.print "Nett : " & vNett
using Currentx affects alignment of text
thanks in advance
cyrus