Board index » cppbuilder » how to get the currently selected printer name from a PrintDialog?
Richard Yu
![]() CBuilder Developer |
Richard Yu
![]() CBuilder Developer |
how to get the currently selected printer name from a PrintDialog?2003-12-11 04:53:44 AM cppbuilder5 when using PrintDialog to select a printer, how to get the name of the printer ? |
JD
![]() CBuilder Developer |
2003-12-11 04:54:03 AM
Re:how to get the currently selected printer name from a PrintDialog?
"Richard Yu" < XXXX@XXXXX.COM >wrote:
Quotewhen using PrintDialog to select a printer, how to get the To display a list of printers for the user to select from: // populate the combo box prnComboBox->Items->Assign( Printer()->Printers ); // make the currently selected printer the selected item in the Combo box prnComboBox->ItemIndex = Printer()->PrinterIndex; To set the printer to the default printer: Printer()->PrinterIndex = -1; HTH ~ JD |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2003-12-11 06:17:32 AM
Re:how to get the currently selected printer name from a PrintDialog?
"JD" < XXXX@XXXXX.COM >wrote in message
QuoteThe TPrintDialog does not have a option for selecting a There is a drop-down menu on that dialog for selecting from the currently installed printers. Gambit {smallsort} |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2003-12-11 06:19:58 AM
Re:how to get the currently selected printer name from a PrintDialog?
"Richard Yu" < XXXX@XXXXX.COM >wrote in message
Quotewhen using PrintDialog to select a printer, how to get the name choosen in the dialog. So, to get the name, simply use the TPrinter::Printers and TPrinter::PrinterIndex properties. Gambit |
Richard Yu
![]() CBuilder Developer |
2003-12-11 06:23:09 AM
Re:how to get the currently selected printer name from a PrintDialog?
My code like this:
if( PrintDialog1->Execute() ) { int index=Printer()->PrinterIndex; MyPostScriptPrinting(printerName); } when starting the PrintDialog1, it allow you to set curr printer, the index chanded each time I make a sel, but I need the printer name in my application. "JD" < XXXX@XXXXX.COM >wrote in message Quote
|
Richard Yu
![]() CBuilder Developer |
2003-12-11 06:36:59 AM
Re:how to get the currently selected printer name from a PrintDialog?
ok now ,
I can use Printer()->GetPrinter(PrnName, PrnDrive, PrnPort, Dmod); "Richard Yu" < XXXX@XXXXX.COM >wrote in message QuoteMy code like this: |