William
I appreciate your reply with regard to the caption property.
Because I would not have knowledge of the end user's printer list or what printer they wish to use, I have changed the original code to the following.
procedure TformViewPhotographs.SpeedButtonPrintSingleClick(Sender: TObject);
var
iPrinterIndex: Integer;
tempPrinterName: string;
begin
iPrinterIndex := -1; // The assumption is that the default printer.PrinterIndex = -1;
Printer.PrinterIndex := iPrinterIndex;
tempPrinterName := Printer.Printers.Strings[Printer.PrinterIndex];
ImageEnView1.io.DoPrintPreviewDialog(iedtDialog, 'Patient - ' + DataPatients.adsTablePatients.FieldByName('FirstName').AsString
+ ' ' + DataPatients.adsTablePatients.FieldByName('LastName').AsWideString, False, 'Print Preview With Default Printer - ' + tempPrinterName);
end;
Suggestion 2:
If there was a mechanism to capture the current PrinterName in an OnCloseUp or OnChange event when the printer was changed in the print preview, then
a) the print preview caption could be updated and
b) the selected printer could be assigned to a global variable and reassigned if the print preview was closed and then reopened.
TIA
John