📄 frmsearch.frm
字号:
VERSION 5.00
Begin VB.Form frmSearch
BorderStyle = 1 'Fixed Single
Caption = "查找记录"
ClientHeight = 2040
ClientLeft = 45
ClientTop = 645
ClientWidth = 5640
ClipControls = 0 'False
DrawMode = 1 'Blackness
FillStyle = 0 'Solid
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontTransparent = 0 'False
HasDC = 0 'False
Icon = "frmSearch.frx":0000
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
NegotiateMenus = 0 'False
ScaleHeight = 136
ScaleMode = 3 'Pixel
ScaleWidth = 376
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame fraOption
Caption = "参数"
Height = 855
Left = 360
TabIndex = 4
Top = 840
Width = 3375
Begin VB.CheckBox chkSubField
Caption = "查找子字段"
Height = 255
Left = 1800
TabIndex = 6
Top = 360
Width = 1335
End
Begin VB.CheckBox chkWhole
Caption = "完全匹配"
Height = 300
Left = 360
TabIndex = 5
Top = 360
Width = 1095
End
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
CausesValidation= 0 'False
Height = 375
Left = 4080
TabIndex = 3
Top = 840
Width = 1215
End
Begin VB.CommandButton cmdSearchNext
Caption = "查找下一个"
CausesValidation= 0 'False
Default = -1 'True
Height = 375
Left = 4080
TabIndex = 2
Top = 360
Width = 1215
End
Begin VB.TextBox txtSearch
CausesValidation= 0 'False
Height = 300
Left = 1320
TabIndex = 1
Top = 360
Width = 2415
End
Begin VB.Label lblSearch
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查找内容"
Height = 180
Index = 1
Left = 360
TabIndex = 0
Top = 360
Width = 720
End
End
Attribute VB_Name = "frmSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub chkSubField_Click()
tkSearchSubField = chkSubField.Value
If chkSubField.Value = 1 Then
chkWhole.Value = 1
End If
End Sub
Private Sub chkWhole_Click()
tkSearchWhole = chkWhole.Value
If chkWhole.Value = 0 Then
chkSubField_Click
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
SetForegroundWindow frmMain.hwnd
End Sub
Public Sub cmdSearchNext_Click()
Dim tkReturn As ListItem
If txtSearch.Text = vbNullString Then
MsgBox "请输入要查找的内容!", vbInformation, "提示"
Else
tkSearchContext = txtSearch.Text
If frmMain.lvDetailData.SelectedItem.Index < frmMain.lvDetailData.ListItems.Count Then
Set tkReturn = frmMain.lvDetailData.FindItem(tkSearchContext, tkSearchSubField, frmMain.lvDetailData.SelectedItem.Index + 1, 1 - tkSearchWhole)
Else
MsgBox "查找记录已结束,请重新开始查找!", vbInformation, Me.Caption
Exit Sub
End If
If tkReturn Is Nothing Then
MsgBox "查找记录已结束,请重新开始查找!", vbInformation, Me.Caption
Else
tkReturn.Selected = True
tkReturn.EnsureVisible
frmMain.tvAdminUser.Nodes(tkReturn.Index + 1).Selected = True
frmMain.tvAdminUser.Nodes(tkReturn.Index + 1).EnsureVisible
End If
txtSearch.SelStart = 0
txtSearch.SelLength = Len(txtSearch.Text)
End If
End Sub
Private Sub Form_Load()
Me.Icon = frmMain.imgLstTools.ListImages(7).Picture
txtSearch.Text = tkSearchContext
chkWhole.Value = tkSearchWhole
chkSubField.Value = tkSearchSubField
End Sub
Private Sub txtSearch_GotFocus()
txtSearch.SelStart = 0
txtSearch.SelLength = Len(txtSearch.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -