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

📄 frmshbb2.frm

📁 大型商业学分统计系统原代码说明 1.如果在向导设置班级数为8时,此数值为班级总数
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      BackColorAlternate=   -2147483643
      GridColor       =   13876923
      GridColorFixed  =   13876923
      TreeColor       =   -2147483632
      FloodColor      =   192
      SheetBorder     =   -2147483642
      FocusRect       =   1
      HighLight       =   1
      AllowSelection  =   -1  'True
      AllowBigSelection=   -1  'True
      AllowUserResizing=   1
      SelectionMode   =   1
      GridLines       =   1
      GridLinesFixed  =   2
      GridLineWidth   =   1
      Rows            =   50
      Cols            =   10
      FixedRows       =   1
      FixedCols       =   1
      RowHeightMin    =   0
      RowHeightMax    =   0
      ColWidthMin     =   0
      ColWidthMax     =   0
      ExtendLastCol   =   0   'False
      FormatString    =   ""
      ScrollTrack     =   -1  'True
      ScrollBars      =   3
      ScrollTips      =   -1  'True
      MergeCells      =   0
      MergeCompare    =   0
      AutoResize      =   0   'False
      AutoSizeMode    =   0
      AutoSearch      =   0
      AutoSearchDelay =   2
      MultiTotals     =   -1  'True
      SubtotalPosition=   1
      OutlineBar      =   0
      OutlineCol      =   0
      Ellipsis        =   0
      ExplorerBar     =   0
      PicturesOver    =   0   'False
      FillStyle       =   1
      RightToLeft     =   0   'False
      PictureType     =   0
      TabBehavior     =   0
      OwnerDraw       =   0
      Editable        =   0
      ShowComboButton =   2
      WordWrap        =   0   'False
      TextStyle       =   0
      TextStyleFixed  =   0
      OleDragMode     =   0
      OleDropMode     =   0
      DataMode        =   1
      VirtualData     =   -1  'True
      ComboSearch     =   3
      AutoSizeMouse   =   -1  'True
      FrozenRows      =   0
      FrozenCols      =   0
      AllowUserFreezing=   3
      BackColorFrozen =   65535
      ForeColorFrozen =   13876923
      WallPaperAlignment=   9
   End
End
Attribute VB_Name = "FRMSHBB2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim s As String
Dim nmc As String
Dim db As Database
Dim rs As Recordset
Dim STR As String
Dim intRecCount As Long
Dim intCounter As Long
Dim XSA As String
Private Sub Command1_Click()
    On Error Resume Next
    Skin1.LoadSkin App.Path & "\SKIN\0.sk"
    Skin1.ApplySkinByName hwnd, "Form"
    Skin1.ApplySkin Me.hwnd
    Vf.Visible = False
    Toolbar2.Visible = False
    VP.Visible = True
    Toolbar1.Visible = True
End Sub
Private Sub Command2_Click()
    On Error Resume Next

    Unload Me
End Sub
Private Sub Command4_Click()
    On Error Resume Next

    Unload Me
End Sub
Private Sub Form_Resize()
    On Error Resume Next

    Vf.Width = Me.Width - 100
    Vf.Height = Me.Height - Toolbar1.Height - 780
    Vf.Top = Toolbar1.Height
    Vf.Left = 0
    VP.Width = Me.Width - 150
    VP.Height = Me.Height - Toolbar2.Height - 400
    VP.Top = Toolbar2.Height
    VP.Left = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    MAIN.Enabled = True
    Unload SCA
    Dim ws As Workspace
    Dim db As Database
    Dim rs As Recordset
    For Each ws In Workspaces
        For Each db In ws.Databases
            For Each rs In db.Recordsets
                rs.Close
                Set rs = Nothing
            Next
            db.Close
            Set db = Nothing
        Next
        ws.Close
        Set ws = Nothing
    Next
End Sub
Private Sub Form_Load()
    On Error Resume Next
    Me.Hide
    SCA.Show
    DoEvents
    Dim ret As Long
    Dim buff As String
    buff = String(255, 0)
    ret = GetPrivateProfileString("三项之和", "平均", Text22.Text, buff, 256, App.Path & "\SET.ini")
    '若.ini MyApp中无Text11,则采用叁数三的值
    Text22.Text = buff
    Dim retA As Long
    Dim buffA As String
    buffA = String(255, 0)
    retA = GetPrivateProfileString("三项之和", "优秀", Text33.Text, buffA, 256, App.Path & "\SET.ini")
    '若.ini MyApp中无Text11,则采用叁数三的值
    Text33.Text = buffA
    Dim retB As Long
    Dim buffB As String
    buffB = String(255, 0)
    retB = GetPrivateProfileString("三项之和", "及格", Text44.Text, buffB, 256, App.Path & "\SET.ini")
    '若.ini MyApp中无Text11,则采用叁数三的值
    Text44.Text = buffB
    Skin1.LoadSkin App.Path & "\SKIN\3.sk"
    Skin1.ApplySkinByName hwnd, "Form"
    Skin1.ApplySkin Me.hwnd
    DoEvents
    If MAIN.CMD2.filename = "" Then MsgBox "数据文件未载入", 32, "提示": Exit Sub
    Set db = OpenDatabase(MAIN.CMD2.filename)
    Set rs = db.OpenRecordset("SELECT * FROM COM WHERE 标记='名称'")
    nmc = rs![代码]
    Me.Caption = "三项之和统计" & "(" & nmc & ")"
    Data1.DatabaseName = MAIN.CMD2.filename
    '对打印的显示百分值进行初始化
    cmbPercent.ListIndex = 3
    cmbZoomMode.ListIndex = 0
    With VP
        .PaperSize = pprA4
        .HdrColor = vbRed
    End With
    '显示数据库的条件,并且载入打印控件
    '        S = "SELECT * FROM 分析表 WHERR 班级>'0' "
    cmbSource
    Call Command1_Click
    Unload SCA
    Me.Show
End Sub
Private Sub Print_Click()
    On Error Resume Next '开始打印
    If VP.PageCount > 0 Then VP.PrintDoc
End Sub
Private Sub scrlPage_Change()
    On Error Resume Next '操作 scrlpage 时同时对下面的当前页显示值进行控制
    scrlPage.SmallChange = VP.PreviewPages
    scrlPage.LargeChange = scrlPage.SmallChange
    VP.PreviewPage = scrlPage.Value
    Dim lp%
    lp = VP.PreviewPage + VP.PreviewPages - 1
    If lp > VP.PageCount Then lp = VP.PageCount
    If lp < VP.PreviewPage Then lp = VP.PreviewPage
    If lp > VP.PreviewPage Then
        lblPage = VP.PreviewPage & " - " & lp & " of " & VP.PageCount
    Else
        lblPage = VP.PreviewPage & " of " & VP.PageCount
    End If
    '操作 scrlpage 时同时对下面的当前页显示值进行控制
End Sub
Private Sub vp_EndPage()
    On Error Resume Next  '得到总页数,并且 scrlpage 自动适应其状态
    scrlPage.Max = VP.PageCount
    scrlPage.Value = VP.PreviewPage
    scrlPage_Change
    DoEvents
    '得到总页数,并且 scrlpage 自动适应其状态
End Sub
Sub RenderRecordset(VP As VSPrinter, rs As Recordset, ByVal maxh As Double)
    On Error Resume Next  '对界面进行自动设置
    On Error Resume Next
    Dim arr, i%, j%, wid!
    rs.MoveLast
    rs.MoveFirst
    i = rs.RecordCount
    If i = 0 Then Exit Sub
    arr = rs.GetRows(i)
    Dim fmt$, hdr$
    For i = 0 To rs.Fields.Count - 1
        If i > 0 Then hdr = hdr & "|"
        fmt = fmt & "|"
        hdr = hdr & rs.Fields(i).Name
        fmt = fmt & 0
    Next
    VP.StartTable
    VP.AddTableArray fmt, hdr, arr
    For i = 0 To rs.Fields.Count - 1
        Select Case rs.Fields(i).Type
            Case dbBigInt, dbByte, dbChar, dbCurrency, dbDecimal, dbDouble, dbFloat, dbInteger, dbLong, dbNumeric, dbSingle, dbDate
                VP.TableCell(tcColAlign) = taCenterMiddle
        End Select
        If rs.Fields(i).Type = dbMemo Then
            VP.TableCell(tcColWidth, , i + 1) = "2.5in"
        Else
            fmt = ""
            For j = 0 To UBound(arr, 2)
                If j > 100 Then Exit For
                If Len(fmt) < Len(arr(i, j)) Then
                    fmt = arr(i, j)
                End If
            Next
            If Len(rs.Fields(i).Name) > Len(fmt) Then fmt = rs.Fields(i).Name
            VP.TableCell(tcColWidth, , i + 1) = (VP.PageWidth - VP.MarginLeft - VP.MarginRight) / rs.Fields.Count
        End If
    Next
    '################################################################
    VP.TableCell(tcFontBold, 0) = True
    VP.TableCell(tcBackColor, 0) = vbYellow
    VP.TableCell(tcRowHeight, 0) = VP.TextHeight("Test") * 3   '设置表格头的字体宽度等
    VP.TableCell(tcAlign, 0) = taCenterMiddle
    '################################################################
    VP.EndTable
    'VP.ShowGuides = gdShow
End Sub
Sub cmbSource()
    On Error Resume Next  '打印代码从此处载入
    '        On Error Resume Next
    MousePointer = vbHourglass
    Dim i%
    Data1.RecordSource = "SELECT * FROM 分析表 WHERE 班级<>'年级'"
    Data1.Refresh
    Dim rs As Recordset
    Set rs = Data1.Recordset
    With VP
        .PenColor = RGB(0, 0, 255)
        .StartDoc
        '  NHB = GetPrivateProfileString("学校", "校名", , , , App.Path & "\SET.ini")
        '   Dim strPath As String
        ' strPath = App.Path & "\SET.ini"
        NHB = GetProfile(App.Path & "\SET.ini", "学校", "校名")
        .Footer = "打印日期:" & Format(Date, "Long Date") & "||备注:三项之和 = 平均分×" & Format(Text22 / 100, "0.0") & " + 优秀率×" & Format(Text33 / 100, "0.0") & " + 及格率×" & Format(Text44 / 100, "0.0") & ""
        .Header = NHB & vbCrLf & vbCrLf & "| " & nmc & "三项之和统计报表 |当前页 %d"
        RenderRecordset VP, rs, 0
        .EndDoc
        .ScrollIntoView 0, 0
    End With
    MousePointer = vbDefault
End Sub
Private Sub btnFont_Click()
    Me.Enabled = False
    On Error Resume Next '设置字体等项目
    With Me.VP
        CommonDialog1.Flags = cdlCFBoth + cdlCFEffects
        CommonDialog1.FontName = .FontName
        CommonDialog1.FontSize = .FontSize
        CommonDialog1.FontBold = .FontBold
        CommonDialog1.FontItalic = .FontItalic
        CommonDialog1.FontUnderline = .FontUnderline
        CommonDialog1.FontStrikethru = .FontStrikethru
        '                CommonDialog1.Color = .PenColor
        CommonDialog1.ShowFont
        .FontName = CommonDialog1.FontName
        .FontSize = CommonDialog1.FontSize
        .FontBold = CommonDialog1.FontBold
        .FontItalic = CommonDialog1.FontItalic
        .FontUnderline = CommonDialog1.FontUnderline
        .FontStrikethru = CommonDialog1.FontStrikethru
        .PenColor = CommonDialog1.Color
        .TextColor = CommonDialog1.Color
    End With
    DoEvents
    cmbSource
    Me.Enabled = True
End Sub
Private Sub SETHARD_Click()
    On Error Resume Next
    Me.Enabled = False
    With Me.VP
        CommonDialog2.Flags = cdlCFBoth + cdlCFEffects
        CommonDialog2.FontName = .HdrFontName
        CommonDialog2.FontSize = .HdrFontSize
        CommonDialog2.FontBold = .HdrFontBold
        CommonDialog2.FontItalic = .HdrFontItalic
        CommonDialog2.FontUnderline = .HdrFontUnderline
        CommonDialog2.FontStrikethru = .HdrFontStrikethru
        CommonDialog2.Color = .HdrColor
        CommonDialog2.ShowFont
        .HdrFontName = CommonDialog2.FontName
        .HdrFontSize = CommonDialog2.FontSize
        .HdrFontBold = CommonDialog2.FontBold
        .HdrFontItalic = CommonDialog2.FontItalic
        .HdrFontUnderline = CommonDialog2.FontUnderline
        .HdrFontStrikethru = CommonDialog2.FontStrikethru
        .HdrColor = CommonDialog2.Color
    End With
    DoEvents
    cmbSource
    Me.Enabled = True
End Sub
Private Sub cmdPageSetup_Click()
    On Error Resume Next '调出页面设置界面
    Me.Enabled = False
    VP.PrintDialog pdPageSetup
    cmbSource
    Me.Enabled = True
End Sub
Private Sub cmbPercent_Click()
    On Error Resume Next '进行百分比操作
    VP.Zoom = Val(cmbPercent.List(cmbPercent.ListIndex))
End Sub
Private Sub cmbZoomMode_Click()
    On Error Resume Next  '当选择了自定义时,则自定义参数生效
    If cmbZoomMode.ListIndex = 0 Then
        cmbPercent_Click
        cmbPercent.Enabled = True
    Else
        cmbPercent.Enabled = False
        VP.ZoomMode = cmbZoomMode.ListIndex
    End If
End Sub

⌨️ 快捷键说明

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