![]() ![]() ![]() Set the paper size based upon the selection in the combo box. Private void MyButtonPrint_Click(object sender, System.EventArgs e) Print the document with the specified paper size, source, and print resolution. PrintDoc->DefaultPageSettings->PrinterResolution = printDoc->PrinterSettings->PrinterResolutions If ( comboPrintResolution->SelectedIndex != -1 ) Set the printer resolution based upon the selection in the combo box. PrintDoc->DefaultPageSettings->PaperSource = printDoc->PrinterSettings->PaperSources If ( comboPaperSource->SelectedIndex != -1 ) Set the paper source based upon the selection in the combo box. PrintDoc->DefaultPageSettings->PaperSize = printDoc->PrinterSettings->PaperSizes The PrinterResolution's ToString() method will be used to provide the display string. Add list of printer resolutions found on the printer to the combobox. PkResolution = printDoc->PrinterSettings->PrinterResolutions ĬomboPrintResolution->Items->Add( pkResolution ) Add list of paper sources found on the printer to the combo box.ĬomboPaperSource.DisplayMember="SourceName" įor (int i = 0 i PrinterSettings->PrinterResolutions->Count i++ ) PkSource = printDoc->PrinterSettings->PaperSources ĬomboPaperSource->Items->Add( pkSource ) The DisplayMember property is used to identify the property that will provide the display string.ĬomboPaperSize.DisplayMember = "PaperName" įor (int i = 0 i DisplayMember = "SourceName" įor ( int i = 0 i PrinterSettings->PaperSources->Count i++ ) Add list of supported paper sizes found on the printer. PaperSize^ pkCustomSize1 = gcnew PaperSize( "First custom size",100,200 ) ĬomboPaperSize->Items->Add( pkCustomSize1 ) Create a PaperSize and specify the custom paper size through the constructor and add to combobox. PkSize = printDoc->PrinterSettings->PaperSizes The DisplayMember property is used to identify the property that will provide the display String*.ĬomboPaperSize->DisplayMember = "PaperName" įor ( int i = 0 i PrinterSettings->PaperSizes->Count i++ ) Das Beispiel erfordert, dass eine PrintDocument Variable mit dem printDoc Namen vorhanden ist und dass die spezifischen Kombinationsfelder vorhanden sind. Paper Source had purchased 30 new stores from its competitor Papyrus just weeks before the pandemic hit in March 2020. Im folgenden Codebeispiel werden drei Eigenschaften für die Standardseite des Dokuments festgelegt, einschließlich der Papierquelle basierend auf der im Kombinationsfeld ausgewählten comboPaperSource Quelle, und druckt dann das Dokument mithilfe Print der Methode. Der in der PrinterName-Eigenschaft bezeichnete Drucker ist nicht vorhanden, oder es wurde kein Standarddrucker installiert. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |