?? printdlg.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "完全控制打印"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 3855
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 3855
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Height = 270
Left = 1680
TabIndex = 3
Text = "Text3"
Top = 1440
Width = 735
End
Begin VB.TextBox Text2
Height = 270
Left = 1680
TabIndex = 2
Text = "Text2"
Top = 840
Width = 735
End
Begin VB.TextBox Text1
Height = 270
Left = 1680
TabIndex = 1
Text = "Text1"
Top = 240
Width = 735
End
Begin VB.CommandButton Command1
Caption = "打印"
Height = 495
Left = 1080
TabIndex = 0
Top = 2160
Width = 1335
End
Begin VB.Label Label3
Caption = "份數:"
Height = 255
Left = 960
TabIndex = 6
Top = 1440
Width = 735
End
Begin VB.Label Label2
Caption = "結束頁:"
Height = 375
Left = 960
TabIndex = 5
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "開始頁:"
Height = 255
Left = 960
TabIndex = 4
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function PRINTDLG Lib "comdlg32.dll" Alias "PrintDlgA" _
(pPrintdlg As PRINTDLG _
) As Long
'類型聲明
Private Type PRINTDLG
lStructSize As Long
hwndOwner As Long
hDevMode As Long
hDevNames As Long
hdc As Long
flags As Long
nFromPage As Integer
nToPage As Integer
nMinPage As Integer
nMaxPage As Integer
nCopies As Integer
hInstance As Long
lCustData As Long
lpfnPrintHook As Long
lpfnSetupHook As Long
lpPrintTemplateName As String
lpSetupTemplateName As String
hPrintTemplate As Long
hSetupTemplate As Long
End Type
Private Sub Command1_Click()
Dim p As PRINTDLG
p.lStructSize = Len(p)
p.hwndOwner = Me.hWnd
p.nFromPage = Text1.Text
p.nToPage = Text2.Text
p.nMinPage = 1
p.nMaxPage = 1
p.nCopies = Text3.Text
x = PRINTDLG(p)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -