Solved

PrintForm and Draws

Posted on 1998-11-19
10
227 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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