Solved

How do I have the text boxes not print.

Posted on 1998-08-04
3
149 Views
Last Modified: 2010-05-03
Hi, I am just learning Visual Basic and working on my first program. I have a form whith text boxes on it. When I print, it prints the boxes as well. Is there a way to have them show yet not print? I want them on th eform so the user knows to input their data but I don't want them to print, only want the info contained in the box to print. I tried setting Visibility to False but then they don't show up on the form at all. Please help me out if you can, email me at developer@xtremeonline.com if possible. Thank you.
0
Comment
Question by:ShawnX
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
jsuper earned 100 total points
ID: 1467809
Just before the code you are using to print the form, change the visibility of the text boxes to false.  Alfter the code that prints has completed, change the visibilty back to a yes.  For example...

Private Sub cmdPrint_Click()
      txtbox1.visible = false
      txtbox2.visible = false
      form.printform
      txtbox1.visible = true
      txtbox2.visible = true
end sub


0
 
LVL 1

Expert Comment

by:jsuper
ID: 1467810
Actually, now I see what you are saying...   here is what you need to do.   For each textbox, create a label as well. Set  each label.visible to false.  When the user says to print, perform the following code.

Private Sub Print_Click()
    label1.caption = text1.text
    label2.caption = text2.text
    label1.top = text1.top
    label2.top = text2.top
       ' do the same for width, height and left...
   label1.visible = true
  label2.visible = true
  text1.visible = false
  text2.visible = false
form1.printform
   ' Now change the visible settings back to the original values...  
   '  i.e.  textboxes as visible and labels as invisible.

That should do what you want...
0
 

Author Comment

by:ShawnX
ID: 1467811
I don't understand. I made them false, then they don't show up at all. Thanks for a fast reply to my question.

I'll just keep trying, till something works.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

706 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

20 Experts available now in Live!

Get 1:1 Help Now