[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Printing lines

Posted on 2000-04-09
10
Medium Priority
?
172 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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

656 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