This property holds the default printer index retrieved by the EnumPrinters method.
Reference
The index of the default printer
Explanation
The PrinterIndex property holds the default printer index retrieved by the EnumPrinters method. If the EnumPrinters method is successful, the index of the default printer can be obtained from the PrinterIndex property. When the PrinterIndex property is -1, this means that the EnumPrinters method has not executed or that it was executed but failed. When the PrinterIndex property is 0 or more, it refers to the index that can be used to access the array of the Printers.Strings property.
Example
In C++Builder
VImageKit1->PrintDraw->EnumPrinters();
if (VImageKit1->PrintDraw->Printers->Count > 0)
{
ComboBox1->Items =
VImageKit1->PrintDraw->Printers;
ComboBox1->ItemIndex =
VImageKit1->PrintDraw->PrinterIndex;
}
In Delphi
VImageKit1.PrintDraw.EnumPrinters();
if (VImageKit1.PrintDraw.Printers.Count > 0) then
begin
ComboBox1.Items :=
VImageKit1.PrintDraw.Printers;
ComboBox1.ItemIndex :=
VImageKit1.PrintDraw.PrinterIndex;
end;
Setting this value
This value cannot be set.
Retrieving this value
This value can be retrieved at runtime.