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

📄 frmprintset.frm

📁 本程序源码是由vb编写的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Height          =   180
      Index           =   7
      Left            =   4470
      TabIndex        =   16
      Top             =   3196
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "左边距:"
      Height          =   180
      Index           =   6
      Left            =   4470
      TabIndex        =   15
      Top             =   2808
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "线粗:"
      Height          =   180
      Index           =   5
      Left            =   4470
      TabIndex        =   14
      Top             =   2420
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "页高:"
      Height          =   180
      Index           =   4
      Left            =   4470
      TabIndex        =   13
      Top             =   1644
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "页宽:"
      Height          =   180
      Index           =   3
      Left            =   4470
      TabIndex        =   12
      Top             =   1256
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "行高:"
      Height          =   180
      Index           =   2
      Left            =   4470
      TabIndex        =   11
      Top             =   2032
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "打印列:"
      Height          =   180
      Index           =   1
      Left            =   4470
      TabIndex        =   10
      Top             =   3585
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "标题:"
      Height          =   180
      Index           =   0
      Left            =   4470
      TabIndex        =   9
      Top             =   480
      Width           =   540
   End
End
Attribute VB_Name = "frmPrintSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Sub cmbPage_Click()

 Select Case cmbPage.Text
 Case "A4 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "210"
   txtPageHeight.Text = "297"
 Case "B5 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "182"
   txtPageHeight.Text = "257"
 Case "A5 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "148"
   txtPageHeight.Text = "210"
 Case "A3 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "297"
   txtPageHeight.Text = "420"
 Case "B3 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "364"
   txtPageHeight.Text = "514"
 Case "16开 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "184"
   txtPageHeight.Text = "260"
 Case "32开 纸张"
   txtPageWidth.Enabled = False
   txtPageHeight.Enabled = False
   txtPageWidth.Text = "130"
   txtPageHeight.Text = "184"
 Case "自定义 纸张"
   txtPageWidth.Enabled = True
   txtPageHeight.Enabled = True
 End Select

End Sub

Private Sub Command1_Click()

    Start_print.N_TiTle = txtTitle.Text
    Start_print.N_PageSize = CInt(cmbPage.ListIndex)
    Start_print.N_PageWidth = CLng(txtPageWidth.Text)
    Start_print.N_PageHeight = CLng(txtPageHeight.Text)
    Start_print.N_RowHeight = CInt(txtRowHeight.Text)
    Start_print.N_Border = CInt(txtBorder.Text)
    Start_print.N_PageLeft = CInt(txtPageLeft.Text)
    Start_print.N_PageTop = CInt(txtPageTop.Text)
    Start_print.N_Cols = txtCols.Text
    PrintSetChange = True
    Unload Me
  
End Sub

Private Sub Command2_Click()

  PrintSetChange = False
  Unload Me
 
End Sub

Private Sub Form_Load()

 '页面配置
 With cmbPage
     .AddItem "A4 纸张"
     .AddItem "B5 纸张"
     .AddItem "A5 纸张"
     .AddItem "A3 纸张"
     .AddItem "B3 纸张"
     .AddItem "16开 纸张"
     .AddItem "32开 纸张"
     .AddItem "自定义 纸张"
     .ListIndex = 0
 End With
    txtTitle.Text = Start_print.N_TiTle
    cmbPage.ListIndex = Start_print.N_PageSize
    If Start_print.N_PageWidth = 0 Then
       txtPageWidth.Text = "210"
       Else
       txtPageWidth.Text = Start_print.N_PageWidth
    End If
    If Start_print.N_PageHeight = 0 Then
       txtPageHeight.Text = "297"
     Else
       txtPageHeight.Text = Start_print.N_PageHeight
    End If
    If Start_print.N_RowHeight = 0 Then
      txtRowHeight.Text = "6"
     Else
      txtRowHeight.Text = Start_print.N_RowHeight
    End If
    If Start_print.N_Border = 0 Then
      txtBorder.Text = "1"
      Else
      txtBorder.Text = Start_print.N_Border
    End If
    If Start_print.N_PageLeft = 0 Then
       txtPageLeft.Text = "5"
       Else
       txtPageLeft.Text = Start_print.N_PageLeft
    End If
    If Start_print.N_PageTop = 0 Then
       txtPageTop.Text = "5"
       Else
       txtPageTop.Text = Start_print.N_PageTop
    End If
    txtCols.Text = Start_print.N_Cols
    
End Sub

Private Sub txtBorder_Change()
If txtBorder.Text = "" Then
     txtBorder.Text = 0
  End If
End Sub

Private Sub txtCols_Change()
 If txtCols.Text = "" Then
   txtCols.Text = "1,2,3,4,5"
  End If
End Sub

Private Sub txtPageHeight_Change()
If txtPageHeight.Text = "" Then
     txtPageHeight.Text = 0
  End If
End Sub

Private Sub txtPageLeft_Change()

  If Val(txtPageLeft.Text) > Val(txtPageWidth.Text) Then
     MsgBox "对不起,页边距不能大于页宽。   ", vbInformation
     txtPageLeft.Text = 0
     Exit Sub
  End If
  If txtPageLeft.Text = "" Then
     txtPageLeft.Text = 0
  End If
End Sub

Private Sub txtPageTop_Change()

  If Val(txtPageTop.Text) > Val(txtPageHeight.Text) Then
     MsgBox "对不起,页边距不能大于页宽。   ", vbInformation
     txtPageTop.Text = 0
     Exit Sub
  End If
If txtPageTop.Text = "" Then
     txtPageTop.Text = 0
  End If
End Sub

Private Sub SaveSet(sType As String)

 '检测数据库是否完整
    On Error Resume Next
    txtTitle.Text = N_TiTle
    cmbPage.ListIndex = N_PageSize
    txtPageWidth.Text = N_PageWidth
    txtPageHeight.Text = N_PageHeight
    txtRowHeight.Text = N_RowHeight
    txtBorder.Text = N_Border
    txtPageLeft.Text = N_PageLeft
    txtPageTop.Text = N_PageTop
    txtCols.Text = N_Cols
    
End Sub

Private Sub txtPageWidth_Change()
  
  If txtPageWidth.Text = "" Then
     txtPageWidth.Text = 0
  End If
  
End Sub

Private Sub txtRowHeight_Change()
  
  If txtRowHeight.Text = "" Then
     txtRowHeight.Text = 0
  End If
  If Val(txtRowHeight.Text) < 4 Then
     txtRowHeight.Text = 4
  End If
End Sub

Private Sub txtTitle_Change()

   lbTitle.Caption = txtTitle.Text
   
End Sub

⌨️ 快捷键说明

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