敬业的IT人 >> 数据库 >> 其他数据库 >> ListView控件搜索函数(VB)

ListView控件搜索函数(VB)

敬业的IT人 互联网 佚名 2008-1-8 16:39:21
    ·我的数字地球!地图搜索服务大比拼
    ·“擦除”搜索记录痕迹的五种应用
    ·用VB写歌词搜索程序
    ·四款专业音乐搜索下载软件横向评测
    ·巧用脱兔搜索全球电影下载
    ·使用百度巧妙搜索电影
    ·将QQ好友搜索到底
    ·一亿网民当你军师 奇酷经验搜索
    ·五款IE搜索工具条终极评测
    ·想不到做的到 百度另类搜索应用
ListView 搜索函数 '**************************************
' 函数名:  SearchListView
' 描述:ListView 搜索函数
'日期:2005.03.05
'**************************************

Option Explicit
Public Sub SearchListView(ListViewX As ListView, SearchString As String, ListViewZ As ListView)
    On Error Resume Next
    Dim w, x, y, z As Integer
    Dim a, b As String
    ListViewX.ListItems.Add , , " "
    ListViewX.ListItems.Item(1).Selected = True
    SearchString = LCase(SearchString)


    Do Until ListViewX.SelectedItem.Index = ListViewX.ListItems.Count
        a = LCase(ListViewX.SelectedItem.Text)
        z = Len(a)
        y = Len(SearchString)


        For x = 1 To z


            If Mid(a, x, y) = SearchString Then


                If ListViewX.SelectedItem = b Then
                Else
                    ListViewZ.ListItems.Add , , ListViewX.SelectedItem
                    b = ListViewX.SelectedItem
                End If
            End If
        Next x
        w = ListViewX.SelectedItem.Index
        w = w + 1
        ListViewX.ListItems.Item(w).Selected = True
    Loop
    ListViewX.ListItems.Remove (ListViewX.ListItems.Count)
End Sub 进入讨论组讨论。
粤ICP备06119539号
Copyright CiscoSky.Org,Some Rights Reserved.
Email:me1228#tom.com