📄 frmresult.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmResult
Caption = "Form1"
ClientHeight = 7470
ClientLeft = 60
ClientTop = 450
ClientWidth = 8790
LinkTopic = "Form1"
ScaleHeight = 7470
ScaleWidth = 8790
StartUpPosition = 3 '窗口缺省
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 5775
Left = 240
TabIndex = 0
Top = 360
Width = 8295
_ExtentX = 14631
_ExtentY = 10186
_Version = 393216
End
End
Attribute VB_Name = "frmResult"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Sub showComTopic()
Dim i As Integer
With Me.MSFlexGrid1 '设置表头
.TextMatrix(0, 0) = "记录编号"
.TextMatrix(0, 1) = "公司名称"
For i = 0 To 1 '设置所有表格对齐方式
.ColAlignment(i) = 4
Next i
.ColWidth(0) = 1000
For i = 1 To 1 '设置每列宽9
.ColWidth(i) = 1500
Next i
End With
Me.MSFlexGrid1.Width = 15000
End Sub
Public Sub showComData(strQuery As String) '显示数据
Dim rs As New ADODB.Recordset
Set rs = getRS(strQuery)
If rs.EOF = False Then
With Me.MSFlexGrid1
.Rows = 1
While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
.TextMatrix(.Rows - 1, 2) = rs(2)
.TextMatrix(.Rows - 1, 3) = rs(3)
.TextMatrix(.Rows - 1, 4) = rs(4)
.TextMatrix(.Rows - 1, 5) = rs(5)
.TextMatrix(.Rows - 1, 6) = rs(6)
.TextMatrix(.Rows - 1, 7) = rs(7)
.TextMatrix(.Rows - 1, 8) = rs(8)
.TextMatrix(.Rows - 1, 9) = rs(9)
rs.MoveNext
Wend
End With
rs.Close
End If
End Sub
Private Sub Form_Load()
Dim sql As String
'If ichangeFlag = 2 Then
' sql = "select * from 散客资料 order by ID"
' Call frmComResult.showComTopic
' Call frmComResult.showComData(sql)
'End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -