Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Search text in listbox in visual basic 6.0 Posted by rashid83 on 31 Jul 2007 at 12:34 AM
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
Report
Re: Search text in listbox in visual basic 6.0 Posted by BitByBit_Thor on 31 Jul 2007 at 3:49 AM
: 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 [code] 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
Report
Re: Search text in listbox in visual basic 6.0 Posted by lionb on 31 Jul 2007 at 6:02 AM
: i want just the complete project
:
What else do you want?
Report
Re: Search text in listbox in visual basic 6.0 Posted by rashid83 on 1 Aug 2007 at 12:43 AM
: 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

Report
Re: Search text in listbox in visual basic 6.0 Posted by BitByBit_Thor on 1 Aug 2007 at 1:19 AM
A simple search function:
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


Best Regards,
Richard

The way I see it... Well, it's all pretty blurry
Report
Re: Search text in listbox in visual basic 6.0 Posted by lionb on 2 Aug 2007 at 11:58 AM
: A simple search function:
:
: 
: 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
: 
:
:
Or this
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
Report
Re: Search text in listbox in visual basic 6.0 Posted by BitByBit_Thor on 3 Aug 2007 at 2:15 AM
:
: 
: 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
: 
:

Or this:
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


Best Regards,
Richard

The way I see it... Well, it's all pretty blurry
Report
Re: Search text in listbox in visual basic 6.0 Posted by lionb on 3 Aug 2007 at 4:21 AM
: :
: : 
: : 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
: : 
: :
:
: Or this:
:
: 
: 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
: 
:
:
That's even better. A forgot about 'Like' statement
Report
Re: Search text in listbox in visual basic 6.0 Posted by rashid83 on 6 Aug 2007 at 3:31 AM
: : :
: : : 
: : : 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
: : : 
: : :
: :
: : Or this:
: :
: : 
: : 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
: : 
: :
: :
: That's even better. A forgot about 'Like' statement

I have done it by my self
thanks for helping me




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.