Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PrintForm and Draws

Posted on 1998-11-19
10
Medium Priority
?
231 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 600 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

877 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