-
June 27th, 2007, 01:34 AM
#1
Print Chart
Hi! I'm having trouble with on how to print my chart. Well, it actually printing but my problem is on how to center the chart on the paper. I don't know on how to set the margin. Can help me on this... Should I set something??? Below is my code:
Private Sub cmdPrint_Click()
Dim schval As Long
Dim obj As Printer
schval = HScroll2.Value
HScroll2.Value = HScroll2.Max
hh = Picture2.Top
tt = Picture2.Left
If MsgBox("Do you wish to print this?" & vbCrLf & "Please specify the number of copy on Options.", vbOKCancel + vbQuestion, "KPI System") = vbCancel Then
Exit Sub
Else
printchart
End If
End Sub
Private Sub printchart()
Dim obj As Object
Set obj = Printer
Printer.PaperSize = vbPRPSA4
For I = 1 To nocopyint
obj.PaintPicture Clipboard.GetData(vbCFDIB), Picture2.Left, Picture2.Top
obj.NewPage
Next
obj.EndDoc
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
|