|
-
Oct 12th, 2014, 12:08 PM
#1
Thread Starter
PowerPoster
Hide arranging form before print
I have code to change forms controls before printing and then back after print
eg; form color from brown to white
Code:
Sub BeforePrint()
lstPrinters.Visible = False
cmdHelp.Visible = False
cmdDeleteCboItem.Visible = False
miFrame1Top = Frame1.Top
picBelowTop.Visible = False
mLFormColor = Me.BackColor
Me.Frame1.BackColor = vbWhite
Frame1.Top = 500
FraProjects.BackColor = vbWhite
Me.BackColor = vbWhite
' Command2.Visible = False
' Command3.Visible = False
End Sub
is their any way to stop the brief viewable changes ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Oct 12th, 2014, 12:35 PM
#2
Re: Hide arranging form before print
put all your controls in a picture box and do
picture1.visible=false
-
Oct 12th, 2014, 12:59 PM
#3
Re: Hide arranging form before print
If you are printing the form, you need these to change before printing, correct? If so, preventing the changes from being visible would result in printing the items & colors you don't want printed I'd think.
-
Oct 12th, 2014, 04:35 PM
#4
Thread Starter
PowerPoster
Re: Hide arranging form before print
Thanks Guys looks as though there is not a simple fix.
I may use another form just for printing
Last edited by isnoend07; Oct 12th, 2014 at 04:36 PM.
Reason: more to add
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Oct 12th, 2014, 04:52 PM
#5
Re: Hide arranging form before print
There are always many ways to do things in VB6....
Here is another suggestion....
Use a picturebox that you size either at design or runtime, covering the area that you want hidden, make it not visible. When printing, make it visible and on top (zorder)... hide it when done. Put a delay of a couple of second for a self vanishing msgbox.... Put "Printing... " in the picture box etc etc...
It's all up to you really. Hope this helps.
-
Oct 12th, 2014, 05:25 PM
#6
Re: Hide arranging form before print
 Originally Posted by isnoend07
Thanks Guys looks as though there is not a simple fix.
I may use another form just for printing 
Adding another form might not be a bad idea if you use it as a "print preview" page. Adding you options in there if needed such as print color/black&white or low/medium/high/draft quality or landscape/portrait etc... make sure you hide those options on printout... as navion said use a picturebox with your options and just hide it when printing...
-
Oct 12th, 2014, 05:28 PM
#7
Re: Hide arranging form before print
Or yet another option, also using a picturebox
Before printing, size hidden picturebox (autoredraw=true, borderless) to the same size as what is being printed. Print your form to that picturebox, position picturebox over the area to be printed and make it visible. Now change your colors & hide what needs to be hidden & print that to the printer or bitmap you are using for the printer. When printout is done, change back the colors & visibile what you want, then clear & hide that other picturebox.
While that picturebox is visible, it contains screenshot of what your form looked like before printing. Since it's only an image, clicking on it has no effect (i.e., the controls are under that picturebox)
-
Oct 12th, 2014, 05:29 PM
#8
Thread Starter
PowerPoster
Re: Hide arranging form before print
 Originally Posted by Navion
There are always many ways to do things in VB6....
Here is another suggestion....
Use a picturebox that you size either at design or runtime, covering the area that you want hidden, make it not visible. When printing, make it visible and on top (zorder)... hide it when done. Put a delay of a couple of second for a self vanishing msgbox.... Put "Printing... " in the picture box etc etc...
It's all up to you really. Hope this helps.
Thanks for adding that i just might go that route
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Oct 12th, 2014, 06:07 PM
#9
Thread Starter
PowerPoster
Re: Hide arranging form before print
 Originally Posted by LaVolpe
Or yet another option, also using a picturebox
Before printing, size hidden picturebox (autoredraw=true, borderless) to the same size as what is being printed. Print your form to that picturebox, position picturebox over the area to be printed and make it visible. Now change your colors & hide what needs to be hidden & print that to the printer or bitmap you are using for the printer. When printout is done, change back the colors & visibile what you want, then clear & hide that other picturebox.
While that picturebox is visible, it contains screenshot of what your form looked like before printing. Since it's only an image, clicking on it has no effect (i.e., the controls are under that picturebox)
Thanks for adding that. Might be easier to just use another form as i am trying to fix another issue with printout;
http://www.vbforums.com/showthread.p...61#post4770661
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|