📄 frmexplorer.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmExplorer
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "样品检索工具"
ClientHeight = 4785
ClientLeft = 45
ClientTop = 615
ClientWidth = 9735
ControlBox = 0 'False
Icon = "frmExplorer.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4785
ScaleWidth = 9735
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Height = 4500
Left = 105
TabIndex = 8
Top = 90
Width = 1815
Begin VB.ComboBox Combo2
Height = 300
Left = 165
Style = 2 'Dropdown List
TabIndex = 11
Top = 1050
Width = 1500
End
Begin VB.PictureBox Picture2
AutoRedraw = -1 'True
Height = 2400
Left = 120
ScaleHeight = 2340
ScaleWidth = 1515
TabIndex = 10
Top = 1980
Width = 1575
Begin VB.CommandButton Command1
Caption = "显示所有记录"
Height = 390
Left = 0
TabIndex = 3
Top = 390
Width = 1515
End
Begin VB.CommandButton E_Button
Cancel = -1 'True
Caption = "退出检索(&E)"
Height = 390
Left = 0
TabIndex = 7
Top = 1950
Width = 1515
End
Begin VB.CommandButton D_Button
Caption = "删除样品(&D)"
Height = 390
Left = 0
TabIndex = 6
Top = 1560
Width = 1515
End
Begin VB.CommandButton M_Button
Caption = "修改样品(&M)"
Height = 390
Left = 0
TabIndex = 5
Top = 1170
Width = 1515
End
Begin VB.CommandButton N_Button
Caption = "样品登录(&L)"
Height = 390
Left = 0
TabIndex = 4
Top = 780
Width = 1515
End
Begin VB.CommandButton F_Button
Caption = "开始检索(&F)"
Enabled = 0 'False
Height = 390
Left = 0
TabIndex = 2
Top = 0
Width = 1515
End
End
Begin VB.TextBox Text1
Height = 300
Left = 165
MaxLength = 25
TabIndex = 1
Top = 1455
Width = 1500
End
Begin VB.ComboBox Combo1
Height = 300
Left = 165
Style = 2 'Dropdown List
TabIndex = 0
Top = 630
Width = 1500
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
X1 = 30
X2 = 1785
Y1 = 1905
Y2 = 1905
End
Begin VB.Line Line1
X1 = 30
X2 = 1785
Y1 = 1890
Y2 = 1890
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择检索的类型"
ForeColor = &H00C00000&
Height = 180
Left = 195
TabIndex = 9
Top = 300
Width = 1440
End
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 4425
Left = 1980
TabIndex = 12
ToolTipText = "双击弹出控制菜单"
Top = 180
Width = 7590
_ExtentX = 13388
_ExtentY = 7805
_Version = 65541
Rows = 10
Cols = 8
ForeColorFixed = 4194304
BackColorSel = 12648384
ForeColorSel = 192
BackColorBkg = 12632256
AllowBigSelection= 0 'False
FocusRect = 0
ScrollBars = 2
SelectionMode = 1
AllowUserResizing= 1
End
Begin VB.Menu MnuOperating
Caption = "样品操作(&O)"
Begin VB.Menu MnuNewSample
Caption = "新样品登录(&N) ... "
End
Begin VB.Menu MnuModifySample
Caption = "修改选定的样品(&M) ..."
End
Begin VB.Menu MnuDeleteSample
Caption = "删除选定的样品(&D) ..."
End
Begin VB.Menu step10
Caption = "-"
End
Begin VB.Menu MnuDisplayPhoto
Caption = "显示选定样品的图片(&P) ..."
End
End
Begin VB.Menu MnuExit
Caption = "关闭(&C)"
End
End
Attribute VB_Name = "frmExplorer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim RowN As Integer
Private Sub Combo1_Click()
Text1.Text = ""
If Combo1.Text = Pro(6) Or Combo1.Text = Pro(7) Or Combo1.Text = Pro(8) Then
Combo2.Clear
Combo2.AddItem "=", 0
Combo2.AddItem "<", 1
Combo2.AddItem "<=", 2
Combo2.AddItem ">", 3
Combo2.AddItem ">=", 4
Combo2.ListIndex = 0
Else
Combo2.Clear
Combo2.AddItem "等于", 0
Combo2.AddItem "包含", 1
Combo2.ListIndex = 0
End If
SendKeys "{tab}"
End Sub
Private Sub Command1_Click()
Me.MousePointer = 11
'配置网格
Grid1.Visible = False
Grid1.Clear
Grid1.Cols = 7
Grid1.FormatString = "^序号 |^ " & Pro(0) & " |^ " & Pro(2) & " |^ " & Pro(3) & " |^ " & Pro(4) & " |^ " & Pro(6) & " | " & Pro(7) & " | " & Pro(9)
Grid1.ColWidth(0) = 500
Grid1.ColWidth(1) = 900
Grid1.ColWidth(2) = 900
Grid1.ColWidth(3) = 900
Grid1.ColWidth(4) = 1220
Grid1.ColWidth(5) = 800
Grid1.ColWidth(6) = 800
Grid1.ColWidth(7) = 1600
Dim DB As Database, EF As Recordset
Set DB = OpenDatabase(SampleData)
Set EF = DB.OpenRecordset("S_Main", dbOpenTable)
Grid1.Rows = EF.RecordCount + 4
Set EF = DB.OpenRecordset("Select 样品名称,颜色,尺码,风格,批发价,零售价,样品图片 From S_Main", dbOpenDynaset)
HH = 1
Do While Not EF.EOF()
Grid1.Row = HH
Grid1.Col = 1
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(0).Value) Then
Grid1.Text = EF.Fields(0).Value
End If
Grid1.Row = HH
Grid1.Col = 2
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(1).Value) Then
Grid1.Text = EF.Fields(1).Value
End If
Grid1.Row = HH
Grid1.Col = 3
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(2).Value) Then
Grid1.Text = EF.Fields(2).Value
End If
Grid1.Row = HH
Grid1.Col = 4
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(3).Value) Then
Grid1.Text = EF.Fields(3).Value
End If
Grid1.Row = HH
Grid1.Col = 5
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(4).Value) Then
Grid1.Text = EF.Fields(4).Value
End If
Grid1.Row = HH
Grid1.Col = 6
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(5).Value) Then
Grid1.Text = EF.Fields(5).Value
End If
Grid1.Row = HH
Grid1.Col = 7
Grid1.CellAlignment = 1
If Not IsNull(EF.Fields(6).Value) Then
Grid1.Text = EF.Fields(6).Value
End If
EF.MoveNext
HH = HH + 1
Loop
DB.Close
For HH = 1 To Grid1.Rows - 1
Grid1.Row = HH
Grid1.Col = 0
Grid1.Text = HH
If Len(Grid1.Text) = 1 Then
Grid1.Text = "0" + Grid1.Text
End If
Next
Grid1.Col = 1
Grid1.Row = 1
Grid1.ColSel = 7
Grid1.Visible = True
Me.MousePointer = 0
End Sub
Private Sub D_Button_Click()
If Grid1.Text = "" Then Exit Sub
DS = True
frmExplorer.MousePointer = 11
ModifyText = Grid1.Text
frmExplorer.Hide
frmPDelete.Show
frmExplorer.MousePointer = 0
End Sub
Private Sub E_Button_Click()
Unload Me
End Sub
Private Sub F_Button_Click()
Me.MousePointer = 11
'配置网格
Grid1.Visible = False
Grid1.Clear
Grid1.Cols = 7
Grid1.FormatString = "^序号 |^ " & Pro(0) & " |^ " & Pro(2) & " |^ " & Pro(3) & " |^ " & Pro(4) & " |^ " & Pro(6) & " | " & Pro(7) & " | " & Pro(9)
Grid1.ColWidth(0) = 500
Grid1.ColWidth(1) = 900
Grid1.ColWidth(2) = 900
Grid1.ColWidth(3) = 900
Grid1.ColWidth(4) = 1220
Grid1.ColWidth(5) = 800
Grid1.ColWidth(6) = 800
Grid1.ColWidth(7) = 1600
Dim DB As Database, EF As Recordset
Set DB = OpenDatabase(SampleData)
Set EF = DB.OpenRecordset("S_Main", dbOpenTable)
Grid1.Rows = EF.RecordCount + 4
Dim FindStr As String
Dim FindX As String
FindX = Combo1.Text
Select Case FindX
Case Pro(0)
FindX = "样品名称"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
End If
Case Pro(1)
FindX = "样品描述"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
End If
Case Pro(2)
FindX = "颜色"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
End If
Case Pro(3)
FindX = "尺码"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
End If
Case Pro(4)
FindX = "风格"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
End If
Case Pro(5)
FindX = "其它"
If Combo2.Text = "等于" Then
FindStr = FindX + "='" + Text1.Text + "'"
Else
FindStr = FindX + " LIKE '*" + Text1.Text + "*'"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -