views:

203

answers:

3

hey all,
well i want to have an autocompleting textbox like the one in the image below:
this screenshot is from an accounting software. whenever the user focuses on a textbox and starts typing something the suggestions just popup under the control (as seen in the image under the Purc type textbox).This autosuggest functionality even works in the cells of the grid shown in the picture.Moreover the fields in which this autosuggest is enabled allows only values from the autosuggest list to be filled up and nothing else.
i want to emulate similar functionality in my app in vb6. so if you could please guide me in the right direction i would be very grateful.
thanks in advance to all those who take out time to reply.

+2  A: 

Checkout the AutoComplete Text Box at FreeVBCode.com.

Another option is at VBNet. The article shows how to use shlwapi.dll api.

C-Pound Guru
hey thanks for replying so quickly. The first solution didn't work on my pc. haven't tested the second yet.
Amit Kumar Jha
+1  A: 

What I've typically done is do what is included in the project link by C-Pound Guru. Take a TextBox and as the user types into the field have a ListBox fill with results matching the text. The ListBox would by default be hidden but will be made visible when text is entered into the field. When the ListBox is clicked then simply update the TextBox with the ListBox's selected item text then hide the ListBox control again. A quite simple routine to complete.

Jeff
hey thanks for the insight,and yes its simple and yet effective solution to what i want to do but how do i make it work in the datagrid.
Amit Kumar Jha
+1  A: 

VBAccelerator is an excellent site for VB6 tips - try their AutoComplete sample

MarkJ
hey thanks for the link.... it's very good link, but will it work in vb6... also how do i make it work in a datagrid...
Amit Kumar Jha
@Amit Doh! I linked to the VB.Net sample instead of the VB6 one. I've edited it now to link to the VB6 one instead.
MarkJ