?
Solved

Printing lines

Posted on 2000-04-09
10
Medium Priority
?
171 Views
Last Modified: 2010-05-02
I use a picture box where I use the line statement.
Example: Picture.line (x, 2500)-(x,0)
The software draws a graph in this picture box. When trying to print this graph using: Myform.PrintForm everything prints but the graph.
(I use VB 6)
How can I get the graph printed??
0
Comment
Question by:soft4u
[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
10 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699308
try graphics mode = Persistent for the form

Hope this helps
0
 

Author Comment

by:soft4u
ID: 2699439
Never done this, How do I do this, where do I set this??

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699453
Form.AutoRedraw = true
or Picture.AutoRedraw = true
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:soft4u
ID: 2699538
Adjusted points from 200 to 300
0
 

Author Comment

by:soft4u
ID: 2699539
Same problem remains! No printing of lines in picture box.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699567
You are correct, i never tried to print lines in a picturebox, but it works fine when you paint on the form (but i think you don't want this).
You might then try to have a form instead of the picturebox (no border, nor resizable)
I found the article ID: Q77060 in the MSDN how to print the picturebox using API, but you certainly want to print the whole form...



0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 2699929
0
 

Expert Comment

by:mbah022100
ID: 2703003
How about using the printer.line method as you do on your picture box. I never use the printform method to avoid problems as you are encountering. A better way of printing is to do what you did on the picturebox exactly the same on the printer object. It takes some more effort, but once you get used to it you will see that the results are better.
0
 
LVL 1

Expert Comment

by:MinnEE
ID: 2706334
Look at the PaintPicture method to print a Picture box. It has the advantage of allowing you to locate and size the final printout on the paper.
But if you want to get the best looking printout, draw directly to the printer and get the benefit of the higher printer resolution.
0
 
LVL 28

Accepted Solution

by:
Ark earned 1200 total points
ID: 2707189
Private Sub Command1_Click()
Dim PrintingX as Long, PrintingY As Long
Dim PrintingWidth as Long, PrintingHeight as Long
' Set these values as you need
' You can first call .PrintForm method and then paint Picture on form at appropriate position
PrintingX = Printer.CurrentX
PrintingY = Printer.CurrentY
PrintingWidth = Picture1.Width
PrintingHeight = Picture1.Height
Printer.PaintPicture Myform.Picture1.Image, PrintingX, PrintingY, PrintingWidth, PrintingHeight
End Sub

Cheers
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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

764 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