Search code examples
c#printingprintdialog

How Do I Change the Size Of A PrintDialog Form


My C# program allows the user to choose which of several similarly named printers they wish to print some labels to. The standard PrintDialog is fairly narrow compared to the printer names it has to display, so you can't see the full names of all the printers in the drop-down list. Is there a way to increase the width of the PrintDialog form? Since it's a dialog, it's not resizable at run-time. I'd really rather not reinvent the wheel and come up with a brand new form just to enumerate installed printers, small as that task seems.


Solution

  • You obviously know how to create your own Form so I wont suggest that to you.
    But what about adding a combobox, somewhere near your print button, and populate it like this.
    I suggest making the combobox dropdwon only, that way users cannot add their own printer name and F*** it all up.

    foreach (string s in PrinterSettings.InstalledPrinters)
    {
        comboBox1.Items.Add(s);
    }