⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 系统_打印选择项.frm

📁 新世纪ERP设备管理源代码
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form DY_DytsFrm 
   Caption         =   "打印选择项"
   ClientHeight    =   4200
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4635
   HelpContextID   =   2501001
   Icon            =   "系统_打印选择项.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4200
   ScaleWidth      =   4635
   StartUpPosition =   2  '屏幕中心
   Begin MSComDlg.CommonDialog OutPutCommonDialog 
      Left            =   -30
      Top             =   2670
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      Caption         =   "输出到"
      Height          =   1125
      Left            =   120
      TabIndex        =   16
      Top             =   90
      Width           =   4455
      Begin VB.ComboBox FileCombo 
         Height          =   300
         Left            =   1380
         Style           =   2  'Dropdown List
         TabIndex        =   22
         Top             =   720
         Visible         =   0   'False
         Width           =   2955
      End
      Begin VB.OptionButton OutputOption 
         Caption         =   "打印机(&P)"
         Height          =   315
         Index           =   0
         Left            =   150
         TabIndex        =   21
         Top             =   330
         Width           =   1155
      End
      Begin VB.OptionButton OutputOption 
         Caption         =   "文件(&F)"
         Height          =   315
         Index           =   1
         Left            =   150
         TabIndex        =   20
         Top             =   690
         Width           =   1275
      End
      Begin VB.ComboBox DyjCombo 
         Height          =   300
         Left            =   1380
         Style           =   2  'Dropdown List
         TabIndex        =   17
         Top             =   330
         Width           =   2955
      End
   End
   Begin VB.CommandButton BzCommand 
      Caption         =   "帮助(&H)"
      Height          =   300
      Left            =   120
      TabIndex        =   12
      Top             =   3780
      Width           =   1120
   End
   Begin VB.CommandButton QxCommand 
      Caption         =   "取消(&C)"
      Height          =   300
      Left            =   3450
      TabIndex        =   7
      Top             =   3780
      Width           =   1120
   End
   Begin VB.CommandButton QdCommand 
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      Height          =   300
      Left            =   2250
      TabIndex        =   0
      Top             =   3780
      Width           =   1120
   End
   Begin VB.Frame DyfsFrame 
      Caption         =   "份数"
      Height          =   2235
      Left            =   2820
      TabIndex        =   9
      Top             =   1320
      Width           =   1755
      Begin VB.VScrollBar KbfsVScroll 
         Height          =   285
         Left            =   1230
         Max             =   1
         Min             =   32767
         TabIndex        =   6
         Top             =   780
         Value           =   32767
         Width           =   255
      End
      Begin VB.Label KbfsLabel 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   1  'Fixed Single
         Height          =   315
         Left            =   180
         TabIndex        =   14
         Top             =   750
         Width           =   1335
      End
      Begin VB.Label Label3 
         Caption         =   "复制份数"
         Height          =   225
         Left            =   240
         TabIndex        =   13
         Top             =   390
         Width           =   825
      End
   End
   Begin VB.Frame DyfwFrame 
      Caption         =   "打印范围"
      Height          =   2265
      Left            =   120
      TabIndex        =   8
      Top             =   1290
      Width           =   2445
      Begin VB.ComboBox JoyCombo 
         Height          =   300
         Left            =   1140
         Style           =   2  'Dropdown List
         TabIndex        =   18
         Top             =   1830
         Width           =   1185
      End
      Begin VB.OptionButton DyfwOption 
         Caption         =   "页码范围"
         Height          =   315
         Index           =   2
         Left            =   180
         TabIndex        =   3
         Top             =   810
         Width           =   1515
      End
      Begin VB.OptionButton DyfwOption 
         Caption         =   "当前页"
         Height          =   315
         Index           =   1
         Left            =   180
         TabIndex        =   2
         Top             =   510
         Width           =   1515
      End
      Begin VB.TextBox DyzzyText 
         Height          =   300
         Left            =   1530
         TabIndex        =   5
         Top             =   1140
         Width           =   795
      End
      Begin VB.TextBox DyqsyText 
         Height          =   300
         Left            =   480
         TabIndex        =   4
         Top             =   1140
         Width           =   765
      End
      Begin VB.OptionButton DyfwOption 
         Caption         =   "全部"
         Height          =   315
         Index           =   0
         Left            =   180
         TabIndex        =   1
         Top             =   240
         Width           =   1515
      End
      Begin VB.Label Label1 
         Caption         =   "奇偶页选择"
         Height          =   225
         Index           =   1
         Left            =   180
         TabIndex        =   19
         Top             =   1890
         Width           =   915
      End
      Begin VB.Label ZysLabel 
         Height          =   165
         Left            =   210
         TabIndex        =   15
         Top             =   1530
         Width           =   1875
      End
      Begin VB.Label Label2 
         Caption         =   "到"
         Height          =   255
         Index           =   1
         Left            =   1320
         TabIndex        =   11
         Top             =   1200
         Width           =   315
      End
      Begin VB.Label Label2 
         Caption         =   "从"
         Height          =   255
         Index           =   0
         Left            =   210
         TabIndex        =   10
         Top             =   1170
         Width           =   315
      End
   End
End
Attribute VB_Name = "DY_DytsFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim jdzygs As Integer                             '焦点转移个数
Dim Tsxx As String                                '系统提示信息

Private Sub bzCommand_Click()
    Call F1bz
End Sub

Private Sub DyfwOption_Click(Index As Integer)
    If Index = 2 Then
        DyqsyText.Enabled = True
        DyzzyText.Enabled = True
    Else
        DyqsyText.Enabled = False
        DyzzyText.Enabled = False
    End If
End Sub

Private Sub DyqsyText_Change()
    If Val(DyqsyText.Text) = 0 Then
        DyqsyText.Text = 1
    End If
End Sub

Private Sub DyqsyText_KeyPress(KeyAscii As Integer)
    Call Lrzszxz(KeyAscii)
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    jdzygs = 10
    Select Case KeyAscii
        Case vbKeyReturn
            If Kjjdzy(jdzygs) Then
                KeyAscii = 0
            End If
    End Select
End Sub

Private Sub Form_Load()

    With DY_Tybbyldy.Tydy
        For jsqte = 0 To .NDevices - 1
            DyjCombo.AddItem .Devices(jsqte)
        Next jsqte
        DyjCombo.Text = .Device
    End With
  
    With JoyCombo
        .AddItem "所选页面"
        .AddItem "奇数页"
        .AddItem "偶数页"
        .Text = .List(0)
    End With
    
    OutputOption(0).Value = True
    DyfwOption(0).Value = True
    DyqsyText.Text = 1
    DyzzyText.Text = DY_Tybbyldy.Tydy.Pagecount
    DyqsyText.Enabled = False
    DyzzyText.Enabled = False
    KbfsVScroll.Min = 32767
    KbfsVScroll.Max = 1
    KbfsVScroll.Value = 1
    ZysLabel = "报表共" + Trim(Str(DY_Tybbyldy.Tydy.Pagecount)) + "页"

End Sub

Private Sub OutputOption_Click(Index As Integer)            '打印输出设备选择
    
    If Index = 0 Then
        DyjCombo.Enabled = True
        FileCombo.Enabled = False
    Else
        DyjCombo.Enabled = False
        FileCombo.Enabled = True
    End If
    
End Sub

Private Sub QdCommand_Click()
    
    Dim Dyqsy As Long                          '打印起始页
    Dim Dyzzy As Long                          '打印终止页
    
    If OutputOption(1).Value Then
        If Output_File Then
            Unload Me
        End If
    Else
        If Output_Printer Then
            Unload Me
        End If
    End If
    
End Sub

Private Sub QxCommand_Click()
    Unload Me
End Sub

Private Sub KbfsVScroll_Change()
    KbfsLabel = KbfsVScroll.Value
End Sub

Private Function Output_File() As Boolean                     '输出到文件
   
    Dim filenum As Integer
    On Error GoTo Cwcl
    
    With OutPutCommonDialog
        .Filter = "Excel 文件 (*.xls)|*.xls|Word 文档(*.doc)|*.doc|纯文本(*.txt)|*.txt|Html 文档(*.Htm)|*.htm"
        .FilterIndex = 1
        .Flags = 6
        .DialogTitle = "报表输出到文件"
        .Action = 2
        filenum = FreeFile()
        Open .FileName For Output As #filenum
        DY_Tybbyldy.DyylGrid.SaveGrid .FileName, flexFileTabText, True
        Tsxx = "导出成功!"
        Call Xtxxts(Tsxx, 0, 4)
        .FileName = ""
        Close filenum
    End With
    
    Output_File = True
    Exit Function
Cwcl:
    Tsxx = "导出文件未完成!"
    Call Xtxxts(Tsxx, 0, 4)
    Exit Function

End Function

Public Function Output_Printer() As Boolean                                      '输出到打印机
    With DY_Tybbyldy.Tydy
        If DyfwOption(2).Value Then
            If Val(DyzzyText.Text) > .Pagecount Then
                Tsxx = "指定页码必须小于等于总页数!"
                Call Xtxxts(Tsxx, 0, 1)
                DyzzyText.SetFocus
                Exit Function
            End If
            If Val(DyzzyText.Text) < Val(DyqsyText.Text) Then
                Tsxx = "打印终止页必须大于等于起始页!"
                Call Xtxxts(Tsxx, 0, 1)
                DyzzyText.SetFocus
                Exit Function
            End If
            Dyqsy = Val(DyqsyText.Text)
            Dyzzy = Val(DyzzyText.Text)
        End If
        If DyfwOption(0).Value Then
            Dyqsy = 1
            Dyzzy = .Pagecount
        End If
        If DyfwOption(1).Value Then
            Dyqsy = .PreviewPage
            Dyzzy = .PreviewPage
        End If
        .Device = DyjCombo.Text
        .Copies = Val(KbfsLabel)
        .AbortCaption = "正在打印..."
        .AbortTextButton = "取 消"
        .AbortTextDevice = "打印机: %s 通过: %s"
        .AbortTextPage = "正在打印第 %d 页..."
        Select Case JoyCombo.Text
            Case "所选页面"
                .PrintDoc False, Dyqsy, Dyzzy
            Case "奇数页"
                For jsqte = Dyqsy To Dyzzy
                    If jsqte Mod 2 <> 0 Then
                        .PrintDoc False, jsqte, jsqte
                    End If
                Next jsqte
            Case "偶数页"
                For jsqte = Dyqsy To Dyzzy
                    If jsqte Mod 2 = 0 Then
                        .PrintDoc False, jsqte, jsqte
                    End If
                Next jsqte
        End Select
    End With
    Output_Printer = True
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -