类的新实例。

 

命名空间:  System.Drawing.Printing
程序集:  System.Drawing(在 System.Drawing.dll 中)

 
public PaperSize(
	string name,
	int width,
	int height
)

参数

name
类型:System.String
纸张名称。
width
类型:System.Int32
纸张宽度,以百分之一英寸为单位。
height
类型:System.Int32
纸张高度,以百分之一英寸为单位。

 属性值。

 和特定的组合框都已存在。

 
            // Add list of supported paper sizes found on the printer. 
            // The DisplayMember property is used to identify the property that will provide the display string.
            comboPaperSize.DisplayMember = "PaperName";

            PaperSize pkSize;
            for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++){
                pkSize = printDoc.PrinterSettings.PaperSizes[i];
                comboPaperSize.Items.Add(pkSize);
            }

            // Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
            PaperSize pkCustomSize1 = new PaperSize("First custom size", 100, 200);

            comboPaperSize.Items.Add(pkCustomSize1);


相关文章: