Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How can I set or specify the number of pages to be print?

$
0
0

I created a richtextbox to input the text that I want to print, the command for printing which is the button and instead of printdialog box((PrintDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)) to be display, I created combobox which will display the available printers and then print.  Like this code bellow .


To get the available printers:

    foreach (String printer in PrinterSettings.InstalledPrinters)
            {
                        cbox.Items.Add(printer.ToString());
            }

And the button for printing :

 PrintDocument1.PrinterSettings.PrinterName = cbox.SelectedItem.ToString();

PrintDocument1.Print();

 Now what I want to do is I will add some textbox to input the page number to be printed . For example the current pages in the richtextbox are 12pages when I'm going to run the program I will input in the textbox the page/s that I want like (3-7pages). How could it be ? 

Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>