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((PrintDialo g1.ShowDialog() == System.Windows. Forms.DialogRes ult.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 .InstalledPrint ers)
{
cbox.Items.Add( printer.ToStrin g());
}
And the button for printing :
PrintDocument1. PrinterSettings .PrinterName = cbox.SelectedIt em.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 ?
To get the available printers:
foreach (String printer in PrinterSettings .InstalledPrint ers)
{
cbox.Items.Add( printer.ToStrin g());
}
And the button for printing :
PrintDocument1. PrinterSettings .PrinterName = cbox.SelectedIt em.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 ?
Comment