📄 frmopen.frm
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form FrmOpen
BorderStyle = 3 'Fixed Dialog
Caption = "打开表或工作空间"
ClientHeight = 6150
ClientLeft = 705
ClientTop = 1245
ClientWidth = 6540
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Icon = "FrmOpen.frx":0000
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
NegotiateMenus = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 6150
ScaleWidth = 6540
StartUpPosition = 2 '屏幕中心
Begin VB.FileListBox FileInT
Height = 480
Left = 2460
MultiSelect = 1 'Simple
Pattern = "*.F;*.FB"
TabIndex = 10
Top = 4890
Visible = 0 'False
Width = 1575
End
Begin VB.ListBox ListIn
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4560
Left = 3360
MultiSelect = 2 'Extended
Sorted = -1 'True
TabIndex = 9
Top = 900
Visible = 0 'False
Width = 3075
End
Begin VB.TextBox InIndex
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 3360
MaxLength = 12
TabIndex = 8
Text = "*.TAB"
Top = 420
Width = 3075
End
Begin VB.ListBox ListWor
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4545
Left = 3360
Sorted = -1 'True
TabIndex = 7
Top = 930
Visible = 0 'False
Width = 3075
End
Begin VB.DriveListBox DriveIn
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 120
TabIndex = 6
Top = 420
Width = 2985
End
Begin VB.DirListBox DirIn
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4590
Left = 120
TabIndex = 5
Top = 900
Width = 2985
End
Begin VB.CommandButton CommandOK
Caption = "打开(&O)"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 2
Top = 5640
Width = 1845
End
Begin VB.CommandButton CommandCancel
Caption = "退回(&C)"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3990
TabIndex = 1
Top = 5640
Width = 1845
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2910
Top = 5790
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
End
Begin ComctlLib.ProgressBar ProgressBar1
Align = 2 'Align Bottom
Height = 270
Left = 0
TabIndex = 0
Top = 5880
Visible = 0 'False
Width = 6540
_ExtentX = 11536
_ExtentY = 476
_Version = 327682
Appearance = 1
End
Begin VB.Label lblCriteria
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "文件路径"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 180
TabIndex = 4
Top = 150
Width = 795
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "文件属性"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 3390
TabIndex = 3
Top = 150
Width = 795
End
End
Attribute VB_Name = "FrmOpen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim bClick As Boolean
Private Sub SearchFile()
Dim I As Integer, J As Integer
If (bClick = False) Then Exit Sub
CommandOK.Enabled = False
ListIn.Clear
ListWor.Clear
If (FileInT.ListCount < 1) Then Exit Sub
bClick = False
ProgressBar1.Visible = True
ProgressBar1.Min = 0
ProgressBar1.Max = FileInT.ListCount
' PictureCompute.MousePointer = 11
If (RightIndex = ".TAB") Then
ListWor.Visible = False
ListIn.Visible = True
ListIn.Clear
For I = 0 To FileInT.ListCount - 1
ProgressBar1.Value = I
J = InStr(UCase(FileInT.List(I)), RightIndex)
If (J > 0) Then
ListIn.AddItem UCase(FileInT.List(I))
End If
Next I
Else
ListWor.Visible = True
ListIn.Visible = False
ListWor.Clear
For I = 0 To FileInT.ListCount - 1
ProgressBar1.Value = I
J = InStr(UCase(FileInT.List(I)), RightIndex)
If (J > 0) Then
ListWor.AddItem UCase(FileInT.List(I))
End If
Next I
End If
ProgressBar1.Visible = False
If (ListIn.SelCount > 0) Then
CommandOK.Enabled = True
Else
CommandOK.Enabled = False
End If
' PictureCompute.MousePointer = 0
bClick = True
End Sub
Private Sub CommandCancel_Click()
bOKCancel = False
nTabOrWor = 0
Unload Me
End Sub
Private Sub CommandOk_Click()
Dim I As Integer
If (RightIndex = ".TAB") Then
nTabOrWor = ListIn.SelCount
ReDim TabOrWor(1 To nTabOrWor)
nTabOrWor = 0
For I = 0 To ListIn.ListCount - 1
If (ListIn.Selected(I) = True) Then
nTabOrWor = nTabOrWor + 1
TabOrWor(nTabOrWor) = ListIn.List(I)
End If
Next I
Else
nTabOrWor = 1
ReDim TabOrWor(1 To nTabOrWor)
TabOrWor(nTabOrWor) = ListWor.List(ListWor.ListIndex)
End If
LeftRightIndex = InIndex.Text
bOKCancel = True
Unload Me
End Sub
Private Sub dirin_Change()
If Len(DirIn.Path) <= 3 Then
TheInPathTabOrWor = DirIn.Path
Else
TheInPathTabOrWor = DirIn.Path + "\"
End If
FileInT.Path = DirIn.Path
End Sub
Private Sub dirin_LostFocus()
DirIn.Path = DirIn.List(DirIn.ListIndex)
End Sub
Private Sub driveIn_Change()
On Error GoTo DriveHandler
DirIn.Path = DriveIn.Drive
Exit Sub
DriveHandler:
DriveIn.Drive = DirIn.Path
Exit Sub
End Sub
Private Sub FileInT_PathChange()
Call SearchFile
End Sub
Private Sub FileInT_PatternChange()
Call SearchFile
End Sub
Private Sub Form_Load()
Dim TheInPathT As String
If (RightIndex = ".TAB") Then
FrmOpen.Caption = "打开表"
ListWor.Visible = False
ListIn.Visible = True
ListIn.Clear
Else
FrmOpen.Caption = "打开工作空间"
ListWor.Visible = True
ListIn.Visible = False
ListWor.Clear
End If
TheInPathT = TheInPathTabOrWor
bClick = False
InIndex.Text = LeftRightIndex
FileInT.Pattern = "^@%$"
FileInT.Pattern = LeftRightIndex
DriveIn.Drive = Left(TheInPathT, 2)
DirIn.Path = TheInPathT
bClick = True
Call SearchFile
nTabOrWor = 0
End Sub
Private Sub InIndex_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If (KeyCode = 13) Then
FileInT.Pattern = InIndex.Text
End If
End Sub
Private Sub ListIn_Click()
If (bClick = False) Then Exit Sub
If (ListIn.SelCount > 0) Then
CommandOK.Enabled = True
Else
CommandOK.Enabled = False
End If
End Sub
Private Sub ListIn_DblClick()
Call CommandOk_Click
End Sub
Private Sub ListWor_Click()
If (bClick = False) Then Exit Sub
If (ListWor.SelCount > 0) Then
CommandOK.Enabled = True
Else
CommandOK.Enabled = False
End If
End Sub
Private Sub ListWor_DblClick()
Call CommandOk_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -