Question Using Printer?

nvhung.mctt

Member
Joined
Nov 4, 2009
Messages
12
Location
vietnam
Programming Experience
1-3
Dear All,

I wrote vb6 code to use print, it works well t to follow as:

' *** The current paper size in inches
Public PageWidth As Single
Public PageHeight As Single

' *** Page Orientation Flag, 1 - Portrait, 2 - Landscape
Public OrientFlag As Integer


Private Sub Form_Load()

' *** Printer Settings
OrientFlag = Printer.Orientation
If OrientFlag = 1 Then
PageHeight = 11
PageWidth = 8.5
Else
PageHeight = 8.5
PageWidth = 11
End If

Printer.ScaleMode = 5
PrinterWidthInches = Printer.ScaleWidth
PrinterHeightInches = Printer.ScaleHeight
Printer.ScaleMode = 3
PrinterWidthPixels = Printer.ScaleWidth
PrinterHeightPixels = Printer.ScaleHeight
PrinterTwipsPerPixelX = Printer.TwipsPerPixelX
PrinterTwipsPerPixelY = Printer.TwipsPerPixelY

Printer.TrackDefault = False
Printer.FontTransparent = True

End Sub

Now, I would like convert to vb.net(vb2005). but I do not know how is converter ?.

if you know, please show me.

Thansk you very much
Nguyen Van Hung
 
Last edited by a moderator:

Latest posts

Back
Top