|
-
Jun 20th, 2001, 01:59 AM
#1
Thread Starter
Frenzied Member
Printing a picture containing text
I have a problem regarding printing of text included in a picture box. I have used the following code:
Code:
Private Sub Command1_Click()
Picture1.Cls
Picture1.FontName = "arial"
'Printer.Print ; Tab(10); ""
Picture1.FontSize = 10
Picture1.Print ; Tab(10); "Date: "; Date
Picture1.Print ; Tab(10); "Project name: "
Picture1.Print ; Tab(10); "Project number: "
Picture1.FontSize = 16
Picture1.FontBold = True
Picture1.Print ; Tab(10); ""
Picture1.Print ; Tab(6.5); "Test of print"
Picture1.Print ; Tab(10); ""
End Sub
Private Sub Command2_Click()
PrintForm
End Sub
The text appears in the picture box on the screen, but when printing it is empty. Is it necessary to use the printer.print - notation for all instaed?
-
Jun 20th, 2001, 03:35 AM
#2
Retired VBF Adm1nistrator
This should do the trick :
Code:
Printer.PaintPicture Picture1.Image, (Printer.Width - Picture1.Width) \ 2, 0
Printer.EndDoc
- jamie
Last edited by plenderj; Jun 21st, 2001 at 03:03 AM.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jun 20th, 2001, 04:31 AM
#3
I don't have my printer on now so I can't test this but make sure the auto redraw property is set to true for both the form and the picture box.
-
Jun 21st, 2001, 02:55 AM
#4
Hyperactive Member
I did like this and it workes fine:
Printer.PaintPicture Picture1.Image, (Printer.Width - Picture1.Width) \ 2, 0
Printer.EndDoc
-
Jun 21st, 2001, 03:04 AM
#5
Retired VBF Adm1nistrator
Thats exactly what I said libero.
You copy-cat ..... er
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jun 21st, 2001, 08:03 AM
#6
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|