How to hide or disable a printer in C# printer dialog?

412 Views Asked by At

There are 3 printers in the printer list, but is there a way to hide or disable one of them when I call the printdialog? For example, how to disable or hide the printers which names start with "Brother MFC", so that only allows users to select "HP" printers?

    PrintDialog printDlg = newPrintDialog();  
    PrintDocument printDoc = newPrintDocument();  
    printDoc.DocumentName = "Print Document";  
    printDlg.Document = printDoc;  
    printDlg.AllowSelection = true;  
    printDlg.AllowSomePages = true;  
    //Call ShowDialog  
    if (printDlg.ShowDialog() == DialogResult.OK) printDoc.Print();  
0

There are 0 best solutions below