MyForm.PrintForm
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
Printable View
MyForm.PrintForm
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
Aaron Young gave me this
Add a Picturebox to your Form..
code: picturebox1.visible = false
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020
Private Sub Command1_Click()
Dim W As Integer
Dim H As Integer
Dim X As Integer
Dim Y As Integer
Dim oX As Single
Dim oY As Single
oX = Left
oY = Top
W = 400
H = 400
Picture1.Move 0, 0, ScaleWidth, ScaleHeight
For Y = 0 To Int(ScaleHeight / H) + 1
For X = 0 To Int(ScaleWidth / W) + 1
Move ScaleX(-X * W, vbPixels, vbTwips), ScaleY(-Y * H, vbPixels, vbTwips)
DoEvents
BitBlt Picture1.hDC, X * W, Y * H, W, H, hDC, X * W, Y * H, SRCCOPY
Next
Next
Move oX, oY
Printer.PaintPicture Picture1.Image, 0, 0
Printer.EndDoc
End Sub
Private Sub Form_Load()
ScaleMode = vbPixels
With Picture1
.Visible = False
.BorderStyle = vbBSNone
.ScaleMode = vbPixels
.AutoRedraw = True
End With
End Sub
I have a form in an app with a Flexgrid plenty of data I just want to print that form.
When the user press one button the app have to print the active form. The same the user see in the screen but in paper.
Which is the simplest way of doing it??
Do I have to use the printer object??
Any advice will be greatly apreciatted.
Nauj