Solved

PrintForm and Draws

Posted on 1998-11-19
10
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

623 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