Solved

PrintForm and Draws

Posted on 1998-11-19
10
223 Views
Last Modified: 2010-08-05
How can You print a Form with draws obtained with Pset and/or Circle inside a PictureBox ?
0
Comment
Question by:jabrantes
  • 5
  • 3
  • 2
10 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445650
Try this:
'put this in a module
Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (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

BitBlt Printer.hDC, 10, 10, form1.width, form1.height, form1.hdc, 0,0, vbSrcCopy

Tell me how it goes
0
 

Author Comment

by:jabrantes
ID: 1445651
Dear MikeP

Thank you for your answer, but it not work.
I had tried to do like this:

'Inside one Module
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

Sub main()

Load Form1
Form1.Show

End Sub

'The Form1 have one PictureBox(Picture1) and a CommandBottom (Command1) and the code is:

Private Sub Picture1_Click()

Picture1.Scale (0, 0)-(100, 100)
Picture1.Circle (50, 50), 20

End Sub

Private Sub Command1_Click()
BitBlt Printer.hDC, 10, 10, Form1.Width, Form1.Height, Form1.hDC, 0, 0, vbSrcCopy

End Sub


So, I ask you for some other suggestion.

Thank you
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445652
Did you simply try PrintForm?
What errors do you get with the code above?
0
 

Author Comment

by:jabrantes
ID: 1445653
PrintForm function, with AutoRedraw set to True or to False, only gives a clean PictureBox, without the circle.
The above code don't give any kind of error, but don't work.
If you have more suggestion, please tell me.

Thanks
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445654
Reject my answer for now, if I'll have any suggestions, I'll post.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:jabrantes
ID: 1445655
Adjusted points to 300
0
 
LVL 1

Expert Comment

by:Aleck
ID: 1445656
What is your Version VB?
0
 

Author Comment

by:jabrantes
ID: 1445657
I have the VB5
0
 
LVL 1

Accepted Solution

by:
Aleck earned 300 total points
ID: 1445658
draw in the printer.

 Printer.Scale (0, 0)-(100, 100)
 Printer.Circle (50, 50), 20
 Printer.EndDoc
0
 

Author Comment

by:jabrantes
ID: 1445659
With your suggestion, the printer only gives the circle, not all the Form.
Now I have the PrintForm function to obtain one part of the screen and your suggestion to obtain the other. So, how can I combine the two methods ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now