Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I have the text boxes not print.

Posted on 1998-08-04
3
Medium Priority
?
160 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 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

783 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