Click to See Complete Forum and Search --> : The picture box question


kch913
November 13th, 2002, 10:57 AM
I draw the graph in the picture box, then i try print it out on printer, but i failure, because i use the code like this,
(e.Graphics.DrawImage(picturebox1.Image,x,y))
i know what problem occur, but i cannot solve it.

the last question is, how to link our program to othe program, like i write my help file in html format, i want to click the help button in program, then it will automatically link to that.

thank a lot

Athley
November 14th, 2002, 02:58 AM
About the picture question. I think you have to give us more code here because I did a test with a button and a picture box and the code below, and it worked for me:

Dim WithEvents p As New System.Drawing.Printing.PrintDocument()

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

p.Print()

End Sub

Private Sub p_PrintPage(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles p.PrintPage

e.Graphics.DrawImage(PictureBox1.Image, 0, 0)

End Sub

The link below directs you to a thorough example about help providing. It has the linking to htm files among alot more.

Help project (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_AssociatingHelpwithanApplication.asp)

/Leyan