DB Lists Searching ("Windows Help-style") 
Author Message
 DB Lists Searching ("Windows Help-style")

Hi ,
I was just getting back into doing some VB after a long boring period of
user-support stuff and I've worked out how rusty I am. Depressing..
To get to the point : Does anybody know how to get VB (v4.0) to do
something similar to windows help on Win95 & NT. i.e. type search string
in the text box and get the content of DBList below to move and select
entries containing the substring on "as-you-type" basis?

I'd appreciate any help.
Cheers,

                                    Vlad.



Fri, 12 Nov 1999 03:00:00 GMT  
 DB Lists Searching ("Windows Help-style")

Quote:

> Hi ,
> I was just getting back into doing some VB after a long boring period of
> user-support stuff and I've worked out how rusty I am. Depressing..
> To get to the point : Does anybody know how to get VB (v4.0) to do
> something similar to windows help on Win95 & NT. i.e. type search string
> in the text box and get the content of DBList below to move and select
> entries containing the substring on "as-you-type" basis?

> I'd appreciate any help.
> Cheers,

>                                     Vlad.

Try this:

Write a sub which will transverse all the list items of the listbox
control to search the pattern, if the pattern is found, set the
selected property TRUE.  In you textbox control's Change event sub,
call the search sub, so each time when you type a character, the
search sub will be called to find the pattern, make sure to unselect
the previous selection on the listbox:

private sub PatternSearch(Pattern as string)

        for i=0 to MyList.listcount-1
          MyList.Selected(i)=False
          if InStr(1, MyList.List(i), Pattern) >0 then
                MyList.Selected(i)=True
          End if
        Next i
End Sub

private sub MyText_Change()
        PatternSearch(MyText.Text)
End Sub

Hope works.  Good Luck.

Shaojie Hu



Tue, 16 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. "favourites" style list

2. "Property Windows"-style OCX needed

3. "Property Windows"-style OCX needed

4. "Property Windows"-style OCX needed

5. "Property Windows"-style OCX needed

6. "Property Windows"-style OCX needed

7. :::Help with search and "find next":::

8. "HELP!" finding search/replace routine

9. search for french "help files"

10. Style "Carousel"

11. VB Style "Add Project" dialog

12. "DOS" style program in VB5

 

 
Powered by phpBB® Forum Software