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

📄 frmborrow1.frm

📁 本人自己编写的!!!!!看看这样做的怎么样
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; ""
Begin VB.Form frmborrow1 
   Caption         =   "借书信息列表"
   ClientHeight    =   6465
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   7845
   LinkTopic       =   "Form1"
   ScaleHeight     =   6465
   ScaleWidth      =   7845
   StartUpPosition =   3  'Windows Default
   Begin MSFlexGridLib.MSFlexGrid msglist 
      Height          =   3135
      Left            =   120
      TabIndex        =   2
      Top             =   840
      Width           =   7695
      _ExtentX        =   13573
      _ExtentY        =   5530
      _Version        =   393216
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "返 回(&X)"
      Height          =   615
      Left            =   2280
      TabIndex        =   1
      Top             =   4440
      Width           =   1815
   End
   Begin VB.Label lblTitle 
      Caption         =   "借 书 信 息 列 表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   2655
   End
End
Attribute VB_Name = "frmborrow1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtsql As String
Dim mrc As ADODB.Recordset
Dim msgtext As String



Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub Form_Load()
     ShowTitle
  ShowData
   End Sub

Public Sub FormClose()
    Unload Me
    
End Sub

'显示Grid的内容

Private Sub ShowData()
    
    Dim j As Integer
    Dim i As Integer

  
    Set mrc = ExecuteSQL(txtsql, msgtext)
        With msglist
        .Rows = 1
        
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 1 To mrc.Fields.Count
                Select Case mrc.Fields(i - 1).Type
                    Case adDBDate
                        .TextMatrix(.Rows - 1, i - 1) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
                    Case Else
                        .TextMatrix(.Rows - 1, i - 1) = mrc.Fields(i - 1) & ""
                End Select
            Next i
            mrc.MoveNext
        Loop
        
          
    End With
    mrc.Close
    
    
End Sub


'显示Grid表头
Private Sub ShowTitle()
   Dim i As Integer
    Select Case brflagadd
    Case 3
   With msglist
       .Cols = 6
        For i = 0 To 5
         '设置单元大小
           .ColWidth(i) = 1000
            '设置各列的对齐方式
           .ColAlignment(i) = 0
       Next i
       .TextMatrix(0, 0) = "借书证号"
        .TextMatrix(0, 1) = "读者姓名"
        .TextMatrix(0, 2) = "ISBN"
        .TextMatrix(0, 3) = "书  名"
        .TextMatrix(0, 4) = "索书号"
       .TextMatrix(0, 5) = "借书时间"
       
        '固定表头
        .FixedRows = 1
          '表头项居中
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
         .Row = 1
         End With
          Case 4
        With msglist
       .Cols = 7
       For i = 0 To 6
         '设置单元大小
           .ColWidth(i) = 1000
            '设置各列的对齐方式
           .ColAlignment(i) = 0
       Next i
       .TextMatrix(0, 0) = "借书证号"
        .TextMatrix(0, 1) = "读者姓名"
        .TextMatrix(0, 2) = "ISBN"
        .TextMatrix(0, 3) = "书  名"
        .TextMatrix(0, 4) = "索书号"
       .TextMatrix(0, 5) = "借书时间"
        .TextMatrix(0, 6) = "还书时间"
         '固定表头
        .FixedRows = 1
        '表头项居中
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
         .Row = 1
         End With
         End Select
End Sub







⌨️ 快捷键说明

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