Results 1 to 9 of 9

Thread: Hide arranging form before print

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    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

  2. #2
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: Hide arranging form before print

    put all your controls in a picture box and do

    picture1.visible=false

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Hide arranging form before print

    Thanks Guys looks as though there is not a simple fix.
    I may use another form just for printingName:  BeforeAfterPrint.jpg
Views: 348
Size:  53.6 KB
    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

  5. #5
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    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.

  6. #6
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Hide arranging form before print

    Quote Originally Posted by isnoend07 View Post
    Thanks Guys looks as though there is not a simple fix.
    I may use another form just for printingName:  BeforeAfterPrint.jpg
Views: 348
Size:  53.6 KB
    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...

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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)
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Hide arranging form before print

    Quote Originally Posted by Navion View Post
    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

  9. #9

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Hide arranging form before print

    Quote Originally Posted by LaVolpe View Post
    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
  •  



Click Here to Expand Forum to Full Width