Results 1 to 3 of 3

Thread: [RESOLVED] simple print cancel question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2010
    Posts
    80

    Resolved [RESOLVED] simple print cancel question

    I'm sorry for asking such a simple question. I know the answer is so simple I just can't find it on the net and tired of looking for it. I'm using the commondialog in VB6 and when i hit cancel it still prints the page but it also brings up the error handler message so i know it's throwing the error. I just can't seem to get it to not print.

    On Error GoTo cancel_error
    If Text50.Text > "0" Then
    priForm1.Show
    priForm1.Text3.Text = Text51(0).Text
    priForm1.Text4.Text = Text51(1).Text
    priForm1.Hide
    CommonDialog1.ShowPrinter
    CommonDialog1.CancelError = True

    priForm1.PrintForm
    Unload priForm1
    End If


    cancel_error:
    If Err.Number <> cdlCancel Then
    MsgBox "Printing Canceled", vbOKOnly
    End If


    Thank you guys

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

    Re: simple print cancel question

    Swap these 2 lines. Set the flag before showing the printer:
    CommonDialog1.ShowPrinter
    CommonDialog1.CancelError = True
    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}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2010
    Posts
    80

    Re: simple print cancel question

    Thank you that was it

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