|
-
Jul 7th, 2002, 07:55 PM
#1
Thread Starter
Hyperactive Member
printing the form
How can I print the entire form? (to the printer)
-
Jul 7th, 2002, 07:58 PM
#2
-= B u g S l a y e r =-
VB Code:
Private Sub Command1_Click()
Me.PrintForm
End Sub
-
Jul 7th, 2002, 07:58 PM
#3
Member
Private Sub PrintButton_Click()
PrintForm
End Sub
The Programmers Credo -
Protect dumb-ass from himself.
-
Jul 7th, 2002, 08:37 PM
#4
Thread Starter
Hyperactive Member
ok, works sorta, exept.....
my pie chart, which shows up in a pic box, prints to the upper right. how can i force the pie chart to print to the upper right?
-
Jul 7th, 2002, 08:45 PM
#5
Thread Starter
Hyperactive Member
ok, works sorta, exept.....
my pie chart, which shows up in a pic box, prints to the upper right. how can i force the pie chart to print to the upper right?
-
Jul 7th, 2002, 09:18 PM
#6
Fanatic Member
me.printform is good but if you want the user to be able to print more than one copy without having to incessantly press print then use the commondialog.showprinter here is the code that you would use
[Highlight=VB]
Dim BeginPage, EndPage, NumCopies, Orientation, i
CommonDialog1.CancelError = True
On Error GoTo errhandler
CommonDialog1.ShowPrinter
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
Orientation = CommonDialog1.Orientation
For i = 1 To NumCopies
Next
me.printform
printer.enddoc
[\vbcode]
Walter Richardson
Striver2000 Christian Productions
Iam seventeen but since I started VB in June of 01 GOD has been helping me excell by finding this great forum with a bunch of GREAT PEOPLE!
-
Jul 7th, 2002, 10:51 PM
#7
Originally posted by meopilite
ok, works sorta, exept.....
my pie chart, which shows up in a pic box, prints to the upper right. how can i force the pie chart to print to the upper right?
-
Jul 8th, 2002, 08:38 AM
#8
Try this
VB Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_MENU As Byte = &H12
Private Const VK_SNAPSHOT As Byte = &H2C
Private Const KEYEVENTF_KEYUP = &H2
Private Sub cmdPrintForm_Click()
Dim lWidth As Long, lHeight As Long
Clipboard.Clear
Call keybd_event(VK_MENU, 0, 0, 0)
Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
DoEvents
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0)
Printer.Print
If Width > Printer.ScaleWidth Then
lWidth = Printer.ScaleWidth
lHeight = (Printer.ScaleWidth / Width) * Height
Else
lWidth = Width
lHeight = Height
End If
Printer.PaintPicture Clipboard.GetData, 0, 0, lWidth, lHeight
Printer.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
|