Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Windows Forms
  4. How to restrict no of copies in printdialog of any printer

How to restrict no of copies in printdialog of any printer

Scheduled Pinned Locked Moved Windows Forms
helpdesigntutorial
11 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manjari kar
    wrote on last edited by
    #1

    Hi, This is manjari and im facing some problem to getting no of copies.i cant get the particular method to restrict the no of copies in printdialog.tell me the proper method which will restrict the no of copies .menas if a user will give 10 copies to print if that user hv limit for 9 copies then it should blocked.hw i will restrict plz help me. thanks, regards, manjari.:confused:

    How i will design a a form in windows service to print a document.

    D 1 Reply Last reply
    0
    • M manjari kar

      Hi, This is manjari and im facing some problem to getting no of copies.i cant get the particular method to restrict the no of copies in printdialog.tell me the proper method which will restrict the no of copies .menas if a user will give 10 copies to print if that user hv limit for 9 copies then it should blocked.hw i will restrict plz help me. thanks, regards, manjari.:confused:

      How i will design a a form in windows service to print a document.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The short answer is, you can't.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        The short answer is, you can't.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        Wow. Two "you can't" in a row. You're on a anti-roll. :) Yeah, that's pretty weak but what the heck.

        D 1 Reply Last reply
        0
        • L led mike

          Wow. Two "you can't" in a row. You're on a anti-roll. :) Yeah, that's pretty weak but what the heck.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I aim to please! :-D I really thought the long answer was WAY beyond his skill level.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            I aim to please! :-D I really thought the long answer was WAY beyond his skill level.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            M Offline
            M Offline
            manjari kar
            wrote on last edited by
            #5

            Hi Dave, really i appriciate ur view.nw i m in notice period.i m leaving this company.but in this period also he told try to restrict no of copies of print dialog.hw yaar.i tried to set flags of copies and copycount method also set.but it returns only 1 copy not multiple copies.in this 8 days i will give whatever i searched. and one more thing personally i want 2 share with u .when i gave resignation thattime my p.m called me personally and told i want u people for permanent position.why u want to leave this company.i just gave little smile and told what should i will do.i got another offer and i signed the agreement. and one more thing plz give ur mailid,if u want.i want to keep touch with u.hw z ur life going on.if u thing that i m ur true frnd then mail me.take care.bye.hv a nice day. :laugh: :thumbsup:

            How i will design a a form in windows service to print a document.

            M 1 Reply Last reply
            0
            • M manjari kar

              Hi Dave, really i appriciate ur view.nw i m in notice period.i m leaving this company.but in this period also he told try to restrict no of copies of print dialog.hw yaar.i tried to set flags of copies and copycount method also set.but it returns only 1 copy not multiple copies.in this 8 days i will give whatever i searched. and one more thing personally i want 2 share with u .when i gave resignation thattime my p.m called me personally and told i want u people for permanent position.why u want to leave this company.i just gave little smile and told what should i will do.i got another offer and i signed the agreement. and one more thing plz give ur mailid,if u want.i want to keep touch with u.hw z ur life going on.if u thing that i m ur true frnd then mail me.take care.bye.hv a nice day. :laugh: :thumbsup:

              How i will design a a form in windows service to print a document.

              M Offline
              M Offline
              manjari kar
              wrote on last edited by
              #6

              Hi Dave, finally i got the solution.i restricted no of copies of printdialog.my project is finished.takecare.bye.

              How i will design a a form in windows service to print a document.

              D 1 Reply Last reply
              0
              • M manjari kar

                Hi Dave, finally i got the solution.i restricted no of copies of printdialog.my project is finished.takecare.bye.

                How i will design a a form in windows service to print a document.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Then share the solution with everyone else here.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                M 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Then share the solution with everyone else here.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  M Offline
                  M Offline
                  manjari kar
                  wrote on last edited by
                  #8

                  ok. fine i m giving the code for restrict the no of copies of print dialog. if (ds.Tables[0].Rows.Count > 0) { cmd = new MySqlCommand("select credencials.Limit-credencials.`No of Pages` from credencials where UserName='" + txtusername.Text + "' and Password='" + txtpassword.Text + "'", con); { adp = new MySqlDataAdapter(cmd); ds = new DataSet(); adp.Fill(ds); PrintDialog dia = new PrintDialog(); dia.PrinterSettings = ps; if (dia.ShowDialog() == DialogResult.OK) { timer1.Dispose(); Copies = ps.Copies; Copies = (short)(Copies * job.NumberOfPages); if (Copies >= Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString())) { MessageBox.Show("Exceed Printing Limit is " + Copies.ToString()); dia.ShowDialog(); timer1.Dispose(); job.Resume(); this.Hide(); } else { timer1.Dispose(); job.Resume(); this.Hide(); } using this code u can restrict the no of copies of print dialog with ur database copies. takecare. :thumbsup:bye.

                  How i will design a a form in windows service to print a document.

                  D 1 Reply Last reply
                  0
                  • M manjari kar

                    ok. fine i m giving the code for restrict the no of copies of print dialog. if (ds.Tables[0].Rows.Count > 0) { cmd = new MySqlCommand("select credencials.Limit-credencials.`No of Pages` from credencials where UserName='" + txtusername.Text + "' and Password='" + txtpassword.Text + "'", con); { adp = new MySqlDataAdapter(cmd); ds = new DataSet(); adp.Fill(ds); PrintDialog dia = new PrintDialog(); dia.PrinterSettings = ps; if (dia.ShowDialog() == DialogResult.OK) { timer1.Dispose(); Copies = ps.Copies; Copies = (short)(Copies * job.NumberOfPages); if (Copies >= Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString())) { MessageBox.Show("Exceed Printing Limit is " + Copies.ToString()); dia.ShowDialog(); timer1.Dispose(); job.Resume(); this.Hide(); } else { timer1.Dispose(); job.Resume(); this.Hide(); } using this code u can restrict the no of copies of print dialog with ur database copies. takecare. :thumbsup:bye.

                    How i will design a a form in windows service to print a document.

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    This only restricts the number of copies in your app. Your original post came acrossed like you wanted to limit the number of copies in EVERY application running on the system.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    M 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      This only restricts the number of copies in your app. Your original post came acrossed like you wanted to limit the number of copies in EVERY application running on the system.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008

                      M Offline
                      M Offline
                      manjari kar
                      wrote on last edited by
                      #10

                      Hi dave, see first u run ur application then go to any like notepad or pdf or wordpad.give the print option then u wil get the print dialog box after clicking ok the pop up will come to ask username and password while thattime ur job is in pause mode.if valid it will ask for no of copies.if that particular user have limit like 6 copies it cant permit to 7 copies,and it will blocked.thats what he wants.he wants to do this one one exe or a service and implement it.i hope u understud my point. c u. takecare. bye. manjari.

                      How i will design a a form in windows service to print a document.

                      S 1 Reply Last reply
                      0
                      • M manjari kar

                        Hi dave, see first u run ur application then go to any like notepad or pdf or wordpad.give the print option then u wil get the print dialog box after clicking ok the pop up will come to ask username and password while thattime ur job is in pause mode.if valid it will ask for no of copies.if that particular user have limit like 6 copies it cant permit to 7 copies,and it will blocked.thats what he wants.he wants to do this one one exe or a service and implement it.i hope u understud my point. c u. takecare. bye. manjari.

                        How i will design a a form in windows service to print a document.

                        S Offline
                        S Offline
                        subashis halder
                        wrote on last edited by
                        #11

                        Ha Manjari , Pls email me at subashis.halder@wachovia.com Regards Subashis

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups