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

📄 form_setrowheight.frm

📁 仓库扫描管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form_setRowHeight 
   BackColor       =   &H00C0FFFF&
   Caption         =   "设置每页打印行数"
   ClientHeight    =   3765
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4485
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   3765
   ScaleWidth      =   4485
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0FFFF&
      Caption         =   "每页打印总行数(包括表头、表尾、表身等)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   1935
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   3975
      Begin VB.OptionButton optRows 
         BackColor       =   &H00C0FFFF&
         Caption         =   "45行"
         Height          =   375
         Index           =   4
         Left            =   2160
         TabIndex        =   4
         Top             =   1080
         Width           =   1095
      End
      Begin VB.OptionButton optRows 
         BackColor       =   &H00C0FFFF&
         Caption         =   "35行"
         Height          =   375
         Index           =   2
         Left            =   2160
         TabIndex        =   2
         Top             =   360
         Width           =   1095
      End
      Begin VB.OptionButton optRows 
         BackColor       =   &H00C0FFFF&
         Caption         =   "40行"
         Height          =   375
         Index           =   3
         Left            =   360
         TabIndex        =   3
         Top             =   1080
         Width           =   1095
      End
      Begin VB.OptionButton optRows 
         BackColor       =   &H00C0FFFF&
         Caption         =   "30行"
         Height          =   375
         Index           =   1
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.CommandButton cmdClose 
      Caption         =   "&C关闭"
      Height          =   375
      Left            =   2640
      TabIndex        =   6
      Top             =   2880
      Width           =   1095
   End
   Begin VB.CommandButton cmdConfirm 
      Caption         =   "&O确定"
      Height          =   375
      Left            =   600
      TabIndex        =   5
      Top             =   2880
      Width           =   1095
   End
End
Attribute VB_Name = "form_setRowHeight"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdConfirm_Click()
'    If Not IsNumeric(Me.txtRowheight.Text) Then
'        MsgBox "行高必须为数值!", vbCritical, "警告"
'        Me.txtRowheight.SetFocus
'        Exit Sub
'    End If
'    If CDbl(Me.txtRowheight.Text) < 10 Or CDbl(Me.txtRowheight.Text) > 100 Then
'        MsgBox "行高必须大于10且小于100!", vbCritical, "警告"
'        Me.txtRowheight.SetFocus
'        Exit Sub
'    End If
    Dim isValidate As Boolean
    Dim i, k As Integer
    isValidate = False
    For i = 1 To 4
        If Me.optRows(i).Value = True Then
            k = i
            isValidate = True
            Exit For
        End If
    Next
    
    If Not isValidate Then
        MsgBox "请从四个选项中选择个!", vbCritical, "警告"
        Exit Sub
    End If
    If k = 1 Then
        g_rowHeight = 24.5
    End If
    If k = 2 Then
        g_rowHeight = 21
    End If
    If k = 3 Then
        g_rowHeight = 18.5
    End If
    If k = 4 Then
        g_rowHeight = 16.5
    End If
'    g_rowHeight = CDbl(Me.txtRowheight.Text)
    Dim sql As String
'   先删除,再新增
    On Error GoTo errprompt
    wrks.BeginTrans
    sql = "delete from hp_sysParas where (((hp_sysParas.paraCode)='rowHeight')) "
    g_db.Execute (sql)
    sql = "  INSERT INTO hp_sysParas ( paraCode, paraValue, paraDesc ) values('rowHeight','" + CStr(g_rowHeight) + "','每页行高')  "
    g_db.Execute (sql)
    wrks.CommitTrans

    MsgBox "设置成功!", vbInformation, "提示"
    Exit Sub
errprompt:
    wrks.Rollback
    Me.MousePointer = 0
    MsgBox "操作失败!", vbCritical, "警告"
End Sub

Private Sub Form_Load()
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
'    Me.txtRowheight.Text = g_rowHeight
    If g_rowHeight = 24.5 Then
        Me.optRows(1).Value = True
    End If
    If g_rowHeight = 21 Then
        Me.optRows(2).Value = True
    End If
    If g_rowHeight = 18.5 Then
        Me.optRows(3).Value = True
    End If
    If g_rowHeight = 16.5 Then
        Me.optRows(4).Value = True
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    frm_main.Enabled = True
End Sub

⌨️ 快捷键说明

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