PrintGetPrintersCount Method (GdViewer)
Returns the number of all available (installed) printers on the computer.
public int PrintGetPrintersCount()
public function PrintGetPrintersCount(): Integer;
public function PrintGetPrintersCount() : int;
public: int PrintGetPrintersCount();
public:
int PrintGetPrintersCount();
'Declaration
Public Function PrintGetPrintersCount() As Integer
Return Value
The number of available printers. The
GdViewer.GetStat method can be subsequently used or the
GdViewer.PrintGetStat method to determine if this method has been successful.
How to find out the number of currently installed printers on your computer.
'We assume that the GdViewer1 control has been properly integrated.
Dim PrintersCount As Integer = GdViewer1.PrintGetPrintersCount()
If GdViewer1.GetStat() = GdPictureStatus.OK Then
Dim CurPrinter As String = GdViewer1.PrintGetActivePrinter()
If GdViewer1.GetStat() = GdPictureStatus.OK Then
MessageBox.Show("The number of available printers: " + PrintersCount.ToString() + vbCrLf + "The currently active printer is: " + CurPrinter, "GdViewer.PrintGetPrintersCount")
Else
MessageBox.Show("The PrintGetActivePrinter() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetPrintersCount")
End If
Else
MessageBox.Show("The PrintGetPrintersCount() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetPrintersCount")
End If
//We assume that the GdViewer1 control has been properly integrated.
int PrintersCount = GdViewer1.PrintGetPrintersCount();
if (GdViewer1.GetStat() == GdPictureStatus.OK)
{
string CurPrinter = GdViewer1.PrintGetActivePrinter();
if (GdViewer1.GetStat() == GdPictureStatus.OK)
MessageBox.Show("The number of available printers: " + PrintersCount.ToString() +
"\nThe currently active printer is: " + CurPrinter, "GdViewer.PrintGetPrintersCount");
else
MessageBox.Show("The PrintGetActivePrinter() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetPrintersCount");
}
else
MessageBox.Show("The PrintGetPrintersCount() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetPrintersCount");