|
-
Jun 28th, 2003, 01:15 PM
#1
Thread Starter
Addicted Member
How to print a text aligned to right? (RESOLVED)
The easiest way I found to align a text to right (VB6):
VB Code:
Private Sub Command1_Click()
With Printer
.CurrentX = 1000 - .TextWidth("1,000.00")
.CurrentY = 2000
Printer.Print "1,000.00"
.CurrentX = 1000 - .TextWidth("10,000.00")
.CurrentY = 3000
Printer.Print "10,000.00"
.EndDoc
End With
End Sub
What about VB .NET?
Thanks.
Last edited by AlvaroF1; Jul 2nd, 2003 at 10:44 PM.
-
Jun 28th, 2003, 11:00 PM
#2
Sleep mode
-
Jun 29th, 2003, 12:15 PM
#3
Thread Starter
Addicted Member
Thanks, but it's not clear to me.
Do you have any example?
Thank you.
-
Jun 29th, 2003, 02:32 PM
#4
Sleep mode
Just one link from MS website http://msdn.microsoft.com/library/de...ClassTopic.asp . There are much more if you just google it .
-
Jul 2nd, 2003, 10:49 PM
#5
Thread Starter
Addicted Member
VB Code:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim fnt As New Font("Arial", 12)
Dim txt As String
txt = "1,000.00"
e.Graphics.DrawString(txt, fnt, Brushes.Black, 1000 - e.Graphics.MeasureString(txt, fnt).Width, 2000, New StringFormat())
txt = "10,000.00"
e.Graphics.DrawString(txt, fnt, Brushes.Black, 1000 - e.Graphics.MeasureString(txt, fnt).Width, 3000, New StringFormat())
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrintDocument1.Print()
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|