⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findarch.frm

📁 这个是我以前做的一个客户管理系统.包内已经含有源码和所用到的控件.代码是用VB写的,数据库采用MSSQL的.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmFindArch 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "查找客户"
   ClientHeight    =   1875
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5925
   Icon            =   "FindArch.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1875
   ScaleWidth      =   5925
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdClose 
      Caption         =   "关闭(&C)"
      Height          =   345
      Left            =   4260
      TabIndex        =   5
      Top             =   630
      Width           =   1515
   End
   Begin VB.CommandButton cmdFindNext 
      Caption         =   "查找下一个(&N)"
      Height          =   345
      Left            =   4260
      TabIndex        =   4
      Top             =   180
      Width           =   1515
   End
   Begin VB.Frame Frame1 
      Caption         =   "查找方式"
      Height          =   1035
      Left            =   120
      TabIndex        =   1
      Top             =   690
      Width           =   3885
      Begin VB.OptionButton optPartMatch 
         Caption         =   "部分匹配"
         Height          =   255
         Left            =   2280
         TabIndex        =   3
         Top             =   450
         Value           =   -1  'True
         Width           =   1065
      End
      Begin VB.OptionButton optAllMatch 
         Caption         =   "全部匹配"
         Height          =   315
         Left            =   390
         TabIndex        =   2
         Top             =   420
         Width           =   1065
      End
   End
   Begin VB.TextBox txtFindContent 
      Height          =   300
      Left            =   1380
      TabIndex        =   0
      Top             =   150
      Width           =   2625
   End
   Begin VB.Label lblName 
      AutoSize        =   -1  'True
      Caption         =   "客户名称:"
      Height          =   180
      Left            =   180
      TabIndex        =   6
      Top             =   180
      Width           =   900
   End
End
Attribute VB_Name = "frmFindArch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mbFirstFind         As Boolean
Public mDataType        As Integer       '1:LISTVIEW,2:Vsflex
Public mVsf             As VSFlexGrid

Private Sub mInitForm()
    
    Center Me
    optPartMatch.Value = True
    mbFirstFind = True
    
End Sub

Private Function mbFindNextStVsf() As Boolean
'******************************************************
'查找符合条件的客户
    Dim bFullMatch      As Boolean
    Static mbFind       As Boolean
    Static Index        As Integer
    
    On Error GoTo ErrFindNextStVsf
    
    If mbFirstFind Then
        Index = 1
        mbFirstFind = False
        mbFind = False
    End If
    
    If optPartMatch.Value Then
        bFullMatch = False
    Else
        bFullMatch = True
    End If
    
'    Index = frmMain.vsf.FindRow(txtFindContent, Index, Me.Tag, False, bFullMatch)
    Index = mVsf.FindRow(txtFindContent, Index, Me.Tag, False, bFullMatch)
     If Index = -1 Then
        If mbFind = False Then
            MsgBox "很抱歉,没有找到所要查找的内容!!!", vbInformation + vbOKOnly, ""
            mbFindNextStVsf = False
            Exit Function
        Else
            If MsgBox("搜索完毕,是否重新开始搜索?", vbQuestion + vbYesNo, "") = vbYes Then
                mbFirstFind = True
                mbFind = False
                Index = 1
            Else
                Unload Me
            End If
        End If
    Else
        mbFind = True
'        frmMain.vsf.Row = Index
'        frmMain.vsf.ShowCell Index, CInt(Me.Tag)
        mVsf.Row = Index
        mVsf.ShowCell Index, CInt(Me.Tag)
        
        Index = Index + 1
    End If
    
    mbFindNextStVsf = True
    Exit Function
ErrFindNextStVsf:
    mbFindNextStVsf = False
    Screen.MousePointer = vbDefault
    gShowMsg "查找学生出错 frmYFindSt.mbFindNextStVsf"
    
End Function

Private Function mbFindNextSt() As Boolean
'**********************************************
'查找符合条件的学生

'    Dim xItem           As ListItem
'    Dim fPartial        As Integer
'    Static mbFind       As Boolean
'    Static Index        As Integer
'
'    On Error GoTo ErrFindNextSt
'
'
'    If mbFirstFind Then
'        Index = 1
'        mbFirstFind = False
'        mbFind = False
'    End If
'
'    '全部匹配还是部分匹配
'    If optPartMatch.Value Then
'        fPartial = lvwPartial
'    Else
'        fPartial = lvwWhole
'    End If
'
'    If Index >= frmYBrowseSt.lvw.ListItems.Count Then
'        If MsgBox("搜索完毕,是否重新开始搜索?", vbQuestion + vbYesNo, "") = vbYes Then
'                mbFirstFind = True
'                mbFind = False
'                Index = 1
'        Else
'            mbFindNextSt = True
'            Unload Me
'            Exit Function
'        End If
'    End If
'
'    '开始匹配
'    Set xItem = frmYBrowseSt.lvw.FindItem(txtFindContent.Text, lvwText, Index, lvwPartial)
'
'    If xItem Is Nothing Then
'        If mbFind = False Then
'            MsgBox "很抱歉,没有找到所要查找的内容!!!", vbInformation + vbOKOnly, ""
'            mbFindNextSt = False
'            Exit Function
'        Else
'            If MsgBox("搜索完毕,是否重新开始搜索?", vbQuestion + vbYesNo, "") = vbYes Then
'                mbFirstFind = True
'                mbFind = False
'                Index = 1
'            Else
'                mbFindNextSt = True
'                Unload Me
'                Exit Function
'            End If
'        End If
'    Else
'        mbFind = True
'        xItem.Selected = True
'        xItem.EnsureVisible
'        Index = xItem.Index + 1
'    End If
'
'    mbFindNextSt = True
'    Exit Function
'
'ErrFindNextSt:
'    mbFindNextSt = False
'    Screen.MousePointer = vbDefault
'    gShowMsg "搜索学生出错 frmYFindST.mbFindNextSt"
    
End Function

Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdFindNext_Click()
    
    If mDataType = 2 Then
        Call mbFindNextStVsf
    Else
        Call mbFindNextSt
    End If
    
End Sub

Private Sub Form_Load()
    Call mInitForm
End Sub

Private Sub optAllMatch_Click()
    mbFirstFind = True
End Sub

Private Sub optPartMatch_Click()
    mbFirstFind = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -