📄 frm_bookfind.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frm_BookFind
Caption = "图书信息查询"
ClientHeight = 5415
ClientLeft = 60
ClientTop = 345
ClientWidth = 10650
LinkTopic = "Form1"
ScaleHeight = 5415
ScaleWidth = 10650
StartUpPosition = 2 '屏幕中心
Begin MSComctlLib.ImageList ImageList1
Left = 5175
Top = 1980
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_BookFind.frx":0000
Key = ""
EndProperty
EndProperty
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 4200
Left = 45
TabIndex = 7
Top = 630
Width = 6495
_ExtentX = 11456
_ExtentY = 7408
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 570
Left = 0
TabIndex = 6
Top = 0
Width = 10650
_ExtentX = 18785
_ExtentY = 1005
ButtonWidth = 820
ButtonHeight = 953
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 4
Object.Width = 100
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 4
Object.Width = 2000
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查询"
Key = "tbFind"
ImageIndex = 1
Object.Width = 1800
EndProperty
EndProperty
Begin VB.Frame Frame2
Height = 555
Left = 4680
TabIndex = 9
Top = -45
Width = 4065
Begin VB.OptionButton optBF
Caption = "书名"
Height = 285
Index = 0
Left = 90
TabIndex = 1
Top = 180
Width = 915
End
Begin VB.OptionButton optBF
Caption = "入库时间"
Height = 285
Index = 3
Left = 2880
TabIndex = 4
Top = 180
Width = 1095
End
Begin VB.OptionButton optBF
Caption = "作者"
Height = 285
Index = 2
Left = 1950
TabIndex = 3
Top = 180
Width = 915
End
Begin VB.OptionButton optBF
Caption = "出版社"
Height = 285
Index = 1
Left = 1020
TabIndex = 2
Top = 180
Width = 915
End
End
Begin VB.Frame Frame1
Height = 555
Left = 135
TabIndex = 8
Top = -45
Width = 1950
Begin VB.ComboBox cboType
Height = 300
Left = 90
Style = 2 'Dropdown List
TabIndex = 5
Top = 180
Width = 1770
End
End
Begin VB.TextBox txtKey
Height = 285
Left = 2790
TabIndex = 0
Top = 135
Width = 1725
End
End
End
Attribute VB_Name = "frm_BookFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cboType_Click()
Dim rsR As New classCon
Dim rsRe As New ADODB.Recordset
Set rsRe = rsR.FindRecord(Trim(cboType.Text), "类型", "BookInfo")
Set DataGrid1.DataSource = rsRe
End Sub
Private Sub Form_Load()
Dim rsR As New classT
rsR.TypeRecord "BookType", cboType
End Sub
Private Sub Form_Resize()
DataGrid1.Width = Me.ScaleWidth - 50
DataGrid1.Height = Me.ScaleHeight - Toolbar1.Height - 100
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim rsR As New classCon
Dim rsRe As New ADODB.Recordset
Dim sField As String
Dim i As Integer
sField = ""
For i = 0 To 3
If optBF.Item(i).Value = True Then
sField = optBF.Item(i).Caption
End If
Next i
If optBF.Item(3).Value = True Then
txtKey.ToolTipText = "(例)时间格式:2004-4-12"
End If
Select Case Button.Key
Case Is = "tbFind"
Set rsRe = rsR.FindRecord(txtKey.Text, sField, "BookInfo")
Set DataGrid1.DataSource = rsRe
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -