Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Search text in listbox in visual basic 6.0

rashid83rashid83 Posts: 11Member
i have a problem to search a text in a list box in visual basic 6.0
those who want to answere this thread he sould do these steps before sending
1: you should add some items in the list box and these item are include these
thing file path and file name
2: insert some test in a text box and click find
3: the program should search an item if search text is found then it should
highlight the item and id it should not find the text then the next item should selected and search it if found then the cursor automatically selected
that item

those who want to post about this thread he or she should send complete project at
(rashidashraf89@gmail.com)
(rashid__ashraf@hotmail.com)
i want just the complete project
THANKS

Comments

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : i have a problem to search a text in a list box in visual basic 6.0
    : those who want to answere this thread he sould do these steps before
    : sending
    : 1: you should add some items in the list box and these item are
    : include these
    : thing file path and file name
    : 2: insert some test in a text box and click find
    : 3: the program should search an item if search text is found then it
    : should
    : highlight the item and id it should not find the text then the next
    : item should selected and search it if found then the cursor
    : automatically selected
    : that item
    :
    : those who want to post about this thread he or she should send
    : complete project at
    : (rashidashraf89@gmail.com)
    : (rashid__ashraf@hotmail.com)
    : i want just the complete project
    : THANKS
    :

    those who want to post about this thread he or she should send complete project and call themselves idiots ...

    No one here is going to make your homework for you, unless you pay them.
    However, we are all willing to give you help whenever you are stuck.
    Post in [leftbr]code[rightbr] tags what you've already coded and where you are stuck and we'll help you complete it.


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • lionblionb Posts: 1,688Member ✭✭
    : i want just the complete project
    :
    What else do you want?
  • rashid83rashid83 Posts: 11Member
    : i have a problem to search a text in a list box in visual basic 6.0
    : those who want to answere this thread he sould do these steps before
    : sending
    : 1: you should add some items in the list box and these item are
    : include these
    : thing file path and file name
    : 2: insert some test in a text box and click find
    : 3: the program should search an item if search text is found then it
    : should
    : highlight the item and id it should not find the text then the next
    : item should selected and search it if found then the cursor
    : automatically selected
    : that item
    :
    : those who want to post about this thread he or she should send
    : complete project at
    : (rashidashraf89@gmail.com)
    : (rashid__ashraf@hotmail.com)
    : i want just the complete project
    : THANKS
    :
    Sorry For Asking Complete project
    i have the procedure of search and replace strings in list box but i do not
    find just the search and display in list box is any one have this type of procedure then answer
    THANKS

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    A simple search function:
    [code]
    Dim i As Integer

    For i = 0 To List1.ListCount - 1
    If List1.List(i) = "What I am searching for" Then
    MsgBox "Item #" & (i + 1) & " is what you searched for"
    'Select the found entry
    List1.ListIndex = i
    End If
    Next
    [/code]

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • lionblionb Posts: 1,688Member ✭✭
    : A simple search function:
    : [code]:
    : Dim i As Integer
    :
    : For i = 0 To List1.ListCount - 1
    : If List1.List(i) = "What I am searching for" Then
    : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : 'Select the found entry
    : List1.ListIndex = i
    : End If
    : Next
    : [/code]:
    :
    Or this
    [code]
    Dim i As Integer

    For i = 0 To List1.ListCount - 1
    If InStr(List1.List(i), txtSearch.Text) > 0 Then
    MsgBox "Item #" & (i + 1) & " is what you searched for"
    'Select the found entry
    List1.ListIndex = i
    End If
    Next
    [/code]
  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : [code]:
    : Dim i As Integer
    :
    : For i = 0 To List1.ListCount - 1
    : If InStr(List1.List(i), txtSearch.Text) > 0 Then
    : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : 'Select the found entry
    : List1.ListIndex = i
    : End If
    : Next
    : [/code]:

    Or this:
    [code]
    Dim i As Integer

    For i = 0 To List1.ListCount - 1
    If List1.List(i) Like txtSearch.Text Then
    MsgBox "Item #" & (i + 1) & " is what you searched for"
    'Select the found entry
    List1.ListIndex = i
    End If
    Next
    [/code]

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • lionblionb Posts: 1,688Member ✭✭
    : : [code]: :
    : : Dim i As Integer
    : :
    : : For i = 0 To List1.ListCount - 1
    : : If InStr(List1.List(i), txtSearch.Text) > 0 Then
    : : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : : 'Select the found entry
    : : List1.ListIndex = i
    : : End If
    : : Next
    : : [/code]: :
    :
    : Or this:
    : [code]:
    : Dim i As Integer
    :
    : For i = 0 To List1.ListCount - 1
    : If List1.List(i) Like txtSearch.Text Then
    : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : 'Select the found entry
    : List1.ListIndex = i
    : End If
    : Next
    : [/code]:
    :
    That's even better. A forgot about 'Like' statement
  • rashid83rashid83 Posts: 11Member
    : : : [code]: : :
    : : : Dim i As Integer
    : : :
    : : : For i = 0 To List1.ListCount - 1
    : : : If InStr(List1.List(i), txtSearch.Text) > 0 Then
    : : : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : : : 'Select the found entry
    : : : List1.ListIndex = i
    : : : End If
    : : : Next
    : : : [/code]: : :
    : :
    : : Or this:
    : : [code]: :
    : : Dim i As Integer
    : :
    : : For i = 0 To List1.ListCount - 1
    : : If List1.List(i) Like txtSearch.Text Then
    : : MsgBox "Item #" & (i + 1) & " is what you searched for"
    : : 'Select the found entry
    : : List1.ListIndex = i
    : : End If
    : : Next
    : : [/code]: :
    : :
    : That's even better. A forgot about 'Like' statement

    I have done it by my self
    thanks for helping me

Sign In or Register to comment.