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 ?
Re: Hide arranging form before print
put all your controls in a picture box and do
picture1.visible=false
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.
1 Attachment(s)
Re: Hide arranging form before print
Thanks Guys looks as though there is not a simple fix.
I may use another form just for printingAttachment 119539
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.
Re: Hide arranging form before print
Quote:
Originally Posted by
isnoend07
Thanks Guys looks as though there is not a simple fix.
I may use another form just for printing
Attachment 119539
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...
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)
Re: Hide arranging form before print
Quote:
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
Re: Hide arranging form before print
Quote:
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