?? 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 + -