CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: printing

  1. #1
    Join Date
    Apr 2001
    Location
    canada
    Posts
    12

    printing

    I set up the common dialog printer to show
    cmdlg.show printer

    If the user clicks cancel then i want it to be cancelled. I even tried using this
    cmdlg.show printer
    cmdlg.cancelerror = true

    however if i click ok or cancel it still prints. I need to know how to get the cancel button to work.
    Thanks
    Samantha


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: printing

    First add in your project "Microsoft Common Dialog Control"
    (Comdlg32.ocx file) with menu Project / Components.

    Then add one CommonDialog into your Form : CommonDialog1,

    Private Sub Command1_Click()
    ' This enabled Printer setup dialog box
    ' to change the default printer
    Printer.TrackDefault = True

    CommonDialog1.CancelError = True
    On Error Resume Next
    CommonDialog1.ShowPrinter
    If Err = cdlCancel Then Exit Sub ' For Cancel

    ' Then use properties of CommonDialog1 like :
    ' CommonDialog1.Copies
    ' CommonDialog1.FontName
    ' CommonDialog1.Orientation ...
    End Sub




    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: printing

    Already out of vote...!

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured