📄 showingall.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form ShowingAll
BackColor = &H00C0FFFF&
Caption = "所有产品列表"
ClientHeight = 5850
ClientLeft = 60
ClientTop = 345
ClientWidth = 9075
LinkTopic = "Form1"
LockControls = -1 'True
Picture = "ShowingAll.frx":0000
ScaleHeight = 5850
ScaleWidth = 9075
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton exit
Caption = "返 回"
Height = 375
Left = 3960
TabIndex = 2
Top = 5400
Width = 1335
End
Begin MSFlexGridLib.MSFlexGrid bookListGrid
Height = 4455
Left = 0
TabIndex = 0
Top = 720
Width = 9615
_ExtentX = 16960
_ExtentY = 7858
_Version = 393216
Rows = 18
Cols = 14
FixedCols = 0
BackColorBkg = 14737632
SelectionMode = 1
AllowUserResizing= 1
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "产品列表"
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 495
Left = 3600
TabIndex = 1
Top = 120
Width = 1935
End
End
Attribute VB_Name = "ShowingAll"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function bookList_update()
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from books"
Dim i As Integer
Set rs = TransactSQL(sql)
With bookListGrid
.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)
rs.MoveNext
Wend
End With
End Function
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Call bookList_update
End Sub
Private Sub Form_Load()
With bookListGrid
.TextMatrix(0, 0) = "产品编号"
.TextMatrix(0, 1) = "产品名称"
.TextMatrix(0, 2) = "产品类型"
.TextMatrix(0, 3) = "产品单价"
.TextMatrix(0, 4) = "产品说明"
.ColWidth(4) = 1500
.ColWidth(5) = 1500
.ColWidth(8) = 1500
.ColWidth(9) = 1200
.ColWidth(10) = 1200
.ColWidth(11) = 2000
.BackColorFixed = RGB(247, 214, 157)
End With
Call bookList_update
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -