?
Solved

Printing Pictures and Text

Posted on 1997-08-03
6
Medium Priority
?
236 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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