Any experts on the ancient language of Visual Basic (VB6) on here?

Associate
Joined
26 Feb 2004
Posts
970
Location
China (Qinhuangdao)
Hi, Hopefully this is an easy one!

I've narrowed down a printing issue I have and have created a very small project to try to explain it.

I'm using the common dialog control to choose a printer.

I have a Command Button that shows the printers.
I have an Option Button that selects either Portrait of Landscape.
I have a label which displays the printer the user has chosen from the common dialog.

oJh4ry6.png

I have the following code:

Code:
Private Sub CmdPrint_Click()

    CDPrinter.ShowPrinter
    LblPrinter.Caption = Printer.DeviceName

End Sub

Private Sub Form_Load()

    LblPrinter.Caption = Printer.DeviceName

End Sub

Private Sub OptOrientation_Click(Index As Integer)

    If OptOrientation(0) = True Then Printer.Orientation = 1 Else Printer.Orientation = 2

End Sub

My problem:

When I run the program, as long as I don't change the orientation from portrait to landscape, I can choose another printer. However, as soon as I click on Landscape, I can no longer choose another printer.

I can't see what I'm doing wrong?

IIeYw8s.png

YETAWoC.png
 
Last edited:
If I click landscape (or even change to landscape in software when the form loads) I then can only print to the printer that is displayed. I cannot change to another printer.

I'm choosing the printer in the common printer screen that pops up, I can select another printer and click print, but it won't change to the new printer.

All our software is written in VB6, has been since the early nineties. I know it's a dead language (except maybe VBA), but nobody here can write software in any other language.
 
Back
Top Bottom