📄 frmfind.frm
字号:
VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Begin VB.Form frmFind
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "查找"
ClientHeight = 4605
ClientLeft = 45
ClientTop = 435
ClientWidth = 6750
FillStyle = 0 'Solid
Icon = "frmFind.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4605
ScaleWidth = 6750
StartUpPosition = 1 '所有者中心
Begin MSACAL.Calendar calDate
Height = 2535
Left = 1080
TabIndex = 10
Top = 2040
Visible = 0 'False
Width = 4455
_Version = 524288
_ExtentX = 7858
_ExtentY = 4471
_StockProps = 1
BackColor = -2147483633
Year = 2005
Month = 2
Day = 5
DayLength = 1
MonthLength = 1
DayFontColor = 0
FirstDay = 7
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = -1 'True
ShowHorizontalGrid= -1 'True
ShowTitle = -1 'True
ShowVerticalGrid= -1 'True
TitleFontColor = 10485760
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.ComboBox cmbGongju
Appearance = 0 'Flat
BackColor = &H8000000E&
ForeColor = &H80000007&
Height = 300
ItemData = "frmFind.frx":0DDA
Left = 1080
List = "frmFind.frx":0E20
TabIndex = 15
Top = 3120
Width = 4935
End
Begin VB.ComboBox cmbKemu
Appearance = 0 'Flat
BackColor = &H8000000E&
ForeColor = &H80000007&
Height = 300
ItemData = "frmFind.frx":0FB2
Left = 4200
List = "frmFind.frx":0FEC
Style = 2 'Dropdown List
TabIndex = 13
Top = 1680
Width = 2295
End
Begin VB.TextBox txtJieshao
Appearance = 0 'Flat
Height = 300
Left = 720
TabIndex = 12
Top = 2400
Width = 5355
End
Begin VB.TextBox txtDate
Appearance = 0 'Flat
Height = 300
Left = 1080
TabIndex = 11
Top = 1680
Width = 1935
End
Begin VB.TextBox txtZuozhe
Appearance = 0 'Flat
Height = 300
Left = 4095
TabIndex = 9
Top = 465
Width = 2235
End
Begin VB.TextBox txtTitle
Appearance = 0 'Flat
Height = 300
Left = 735
TabIndex = 8
Top = 465
Width = 2310
End
Begin VB.ComboBox cmbType
Appearance = 0 'Flat
BackColor = &H8000000E&
ForeColor = &H80000007&
Height = 300
ItemData = "frmFind.frx":106A
Left = 720
List = "frmFind.frx":10A1
Style = 2 'Dropdown List
TabIndex = 7
Top = 1080
Width = 2295
End
Begin VB.ComboBox cmbNianji
Appearance = 0 'Flat
BackColor = &H8000000E&
ForeColor = &H80000007&
Height = 300
ItemData = "frmFind.frx":1133
Left = 4080
List = "frmFind.frx":1188
Style = 2 'Dropdown List
TabIndex = 6
Top = 1080
Width = 2355
End
Begin VB.Label Label9
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "开发工具:"
Height = 255
Left = 120
TabIndex = 16
Top = 3120
Width = 1095
End
Begin VB.Label Label8
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "科 目:"
Height = 255
Left = 3480
TabIndex = 14
Top = 1680
Width = 855
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 510
Left = 3120
Picture = "frmFind.frx":1324
Top = 3720
Width = 915
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "内容:"
Height = 255
Index = 5
Left = 120
TabIndex = 5
Top = 2400
Width = 735
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "添加日期:"
Height = 255
Index = 4
Left = 120
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "类 型:"
Height = 255
Index = 3
Left = 120
TabIndex = 3
Top = 1080
Width = 735
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "年 级:"
Height = 255
Index = 2
Left = 3480
TabIndex = 2
Top = 1080
Width = 735
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "作 者:"
Height = 255
Index = 1
Left = 3480
TabIndex = 1
Top = 480
Width = 735
End
Begin VB.Label Label1
BackColor = &H00F6F6F6&
BackStyle = 0 'Transparent
Caption = "标 题:"
Height = 255
Index = 0
Left = 120
TabIndex = 0
Top = 480
Width = 735
End
End
Attribute VB_Name = "frmFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub calDate_Click()
calDate.Visible = False
txtDate.Text = CStr(calDate.Year) + "-" + CStr(calDate.Month) + "-" + CStr(calDate.Day)
cmbKemu.SetFocus
End Sub
Private Sub Form_Load()
cmbNianji.ListIndex = 0
cmbType.ListIndex = 0
cmbKemu.ListIndex = 0
cmbGongju.ListIndex = 0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X >= Image1.Left And X <= Image1.Left + Image1.Width And Y >= Image1.Top And Y <= Image1.Top + Image1.Height Then
Image1.BorderStyle = 1
Else
Image1.BorderStyle = 0
End If
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.BorderStyle = 0
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.BorderStyle = 1
End Sub
Private Sub txtDate_Click()
calDate.Visible = True
End Sub
Private Sub txtDate_GotFocus()
calDate.Visible = True
End Sub
Private Sub txtDate_LostFocus()
calDate.Visible = False
End Sub
Private Sub Image1_Click()
'查找
Dim str As String
Dim sql As String
sql = "select * from info"
'标题
If Trim(txtTitle.Text) <> "" Then sql = sql + " where title like '%" + txtTitle.Text + "%'"
'作者
If Trim(txtZuozhe.Text) <> "" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and zuozhe like '%" + txtZuozhe.Text + "%'"
Else
sql = sql + " where zuozhe like '%" + txtZuozhe.Text + "%'"
End If
End If
'年级
If Trim(cmbNianji.Text) <> "(全部)" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and nianji='" + cmbNianji.Text + "'"
Else
sql = sql + " where nianji='" + cmbNianji.Text + "'"
End If
End If
'类型
If Trim(cmbType.Text) <> "(全部)" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and type='" + cmbType.Text + "'"
Else
sql = sql + " where type='" + cmbType.Text + "'"
End If
End If
'时间
If Trim(txtDate.Text) <> "" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and date like '%" + txtDate.Text + "%'"
Else
sql = sql + " where date like '%" + txtDate.Text + "%'"
End If
End If
'科目
If Trim(cmbKemu.Text) <> "(全部)" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and kemu='" + cmbKemu.Text + "'"
Else
sql = sql + " where kemu='" + cmbKemu.Text + "'"
End If
End If
'开发工具
If Trim(cmbGongju.Text) <> "(全部)" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and gongju='" + cmbGongju.Text + "'"
Else
sql = sql + " where gongju='" + cmbGongju.Text + "'"
End If
End If
'介绍
If Trim(txtJieshao.Text) <> "" Then
If InStr(sql, "where") <> 0 Then
sql = sql + " and jieshao like '%" + txtJieshao.Text + "%'"
Else
sql = sql + " where jieshao like '%" + txtJieshao.Text + "%'"
End If
End If
If InStr(sql, "where") <> 0 Then
sql = sql + " and deldate='0'"
Else
sql = sql + " where deldate='0'"
End If
Me.Hide
DoEvents
Dim frmD As frmDocument
Set frmD = New frmDocument
frmD.Caption = "查找"
frmD.Init (sql)
frmD.Show
Dim baocuns As Integer
baocuns = MsgBox("是否保存本次查找", vbYesNo, "询问")
If baocuns = vbYes Then
Load baocun
baocun.sql = sql
baocun.Show vbModal
End If
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -