Solved

Printing Pictures and Text

Posted on 1997-08-03
6
191 Views
Last Modified: 2006-11-17
I need to print a picture, and some text, to the users printer. I am just begining and don't know to much of VB so I will need your help step by step if you can.  Also how can yyou get a response from a user.  Like I know the Dim command and all that but I can't get results.  Like make a text box then when the user enters text and pushes a command button, it saves the info the user typed in. If you know either tell me.  Thanks
0
Comment
Question by:Todd21
6 Comments
 
LVL 2

Expert Comment

by:PedroMVGomes
Comment Utility
let's see...the best way to print in visual basic is to use the form print method. So you must put the picture you whant in a picture box and the call the form print method. The same goes for the text, but now use the label object to represent the text

The second is simple...put everyting you whant in the form, and the command button, now in design time click in the button, you will see that now you are in code view and vb has added a sub to your cod, it's call MyButton_Click (were mybutton is your button name). Here you should add all the code you need to save the user info.
0
 

Author Comment

by:Todd21
Comment Utility
You may have the right idea there but I said Im new.. :) I only know a few commands but understand some of them.  So what is the Form print method?  I have 2 pictures on the form that I want to print.  Then I have a Text Box on it and ask the user to enter his name and push Command1..  I rename it of course but then I want it to say a message below like "Welcome User Name"  I can not figure that out though.  So when the user click's print I want it to print out the 2 pictures and the message.  This is just an example.  
2nd thats the problem I can't get the code to display anything.  Say I type in using  a dim command
Project name or whatever..
Dim Tax
Tax = 1.065
Item = 2.00
Amount = Tax * Item
Now even if Visual basic does this and finds the tax for $2.00 how could I get it to display the amount?  And how could I get it for the user to be able to enter the item amount.
Item = "User Defined" so they could change that.  I might be able to learn some of that I'm reading Visual Basic for Dummies right now for it but most of it is on the User Interface and that's the easy part.
0
 
LVL 1

Expert Comment

by:olx
Comment Utility
Hi Todd21 it seems that we need a little bit more of info for your app.

* what your app is
* what must it do (step by step please)
* where are you having troubles
* what versions are you using (win/vb)

that would help a lot to help u out

(i also speak spanish if you like)
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Todd21
Comment Utility
No thanks on the spanish part.  Como es tas?  that's about all.

Anyways I have Windows 95 and Visual Basic 5.0.

I have an application that I need to have it print all the picture boxes, images, and text boxes, and labels on to the users printer.  I have no idea what commands to use for this.  I believe I can figure out how to make the info the user enters to show up now just by linking the two text boxes, and making one not visible.  It's nothing big I just want to know first off what commands to use.  Then how to figure out how to find what the user defined as the printer port.  Not just set it to LTP1.  That's it.  Just need to know how to make it print out everything on my Form1.  If this explains it better.

Sum that up is = I just want to print everything on my Form1 to the printer.  Images, labels, text boxes, all of it.  I know none of the commands and will need help with it.
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
Comment Utility
Todd, it's not pretty output, but try this:

 MyForm.PrintForm

Where MyForm is your form name that you want to print.  Works like the old Prt Sc key under DOS, but for graphics forms.

Other than that, it get's pretty complicated. You have to start using the Printer Object, whch has some known bugs, particularly in printing multiple pages, with text and in the are of retaining fonts.  I'd reccomend that when you get serious, you look at the control set from Videosoft. Their VS-View control is much improved over what you can get in Raw VB, and gives you full screen preview ability as well.  You can download a trial version from their site.
0
 

Author Comment

by:Todd21
Comment Utility
Great! Thanks thats the main part I needed and you answered first so thank you.  One more question you don't need to answer sence you got the points, but can I have it set up like now it printed my form once on the top left.  Is there ways to have it keep printing.  Like more then one on a page and setting it up like that?  You don't have to answer, but it would be appreciated.  I am downloading the demo also so thank you very much!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now