Solved

Printing Pictures and Text

Posted on 1997-08-03
6
221 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
[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
6 Comments
 
LVL 2

Expert Comment

by:PedroMVGomes
ID: 1429453
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
ID: 1429454
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
ID: 1429455
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:Todd21
ID: 1429456
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
ID: 1429457
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
ID: 1429458
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…

738 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