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

📄 form3.frm

📁 vbsql做的销售管理课程设计样本不完全仅为范例
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form form3 
   ClientHeight    =   4320
   ClientLeft      =   4185
   ClientTop       =   4185
   ClientWidth     =   7815
   LinkTopic       =   "Form1"
   ScaleHeight     =   4320
   ScaleWidth      =   7815
   Begin VB.CommandButton cmdExit 
      Caption         =   "返回 (&X)"
      Height          =   375
      Left            =   3240
      TabIndex        =   2
      Top             =   3240
      Width           =   1215
   End
   Begin MSFlexGridLib.MSFlexGrid msgList 
      Height          =   2292
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   7572
      _ExtentX        =   13361
      _ExtentY        =   4048
      _Version        =   393216
      Cols            =   4
      FixedCols       =   3
      AllowUserResizing=   1
   End
   Begin VB.Label label1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Left            =   1440
      TabIndex        =   0
      Top             =   240
      Width           =   4575
   End
End
Attribute VB_Name = "form3"
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)
        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 1
    Label1.Caption = "产  品  信  息  列  表"
   With msgList
       .Cols = 4
        For i = 0 To 3
         '设置单元大小
           .ColWidth(i) = 1000
            '设置各列的对齐方式
           .ColAlignment(i) = 0
       Next i
       .TextMatrix(0, 0) = "产品编号"
        .TextMatrix(0, 1) = "产品名称"
        .TextMatrix(0, 2) = "价格"
        .TextMatrix(0, 3) = "库存量"
              
        '固定表头
        .FixedRows = 1
          '表头项居中
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
         .Row = 1
         End With
          Case 2
          Label1.Caption = "销  售  商  信  息  列  表"
        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) = "地  区"
        .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
         End Select
End Sub





⌨️ 快捷键说明

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