'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 selected printer is: " + CurPrinter, "GdViewer.PrintGetActivePrinter")
Else
MessageBox.Show("The PrintGetActivePrinter() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetActivePrinter")
End If
Else
MessageBox.Show("The PrintGetPrintersCount() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetActivePrinter")
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 selected printer is: " + CurPrinter, "GdViewer.PrintGetActivePrinter");
else
MessageBox.Show("The PrintGetActivePrinter() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetActivePrinter");
}
else
MessageBox.Show("The PrintGetPrintersCount() method has failed with the status: " + GdViewer1.PrintGetStat(), "GdViewer.PrintGetActivePrinter");