Presenter:Beth Massi
Visual Basic programmers will see how to set up client side filtering and text editing using the Auto-Complete feature of the ComboBox and the TextBox.
Click here to go to original video page
Minute 0
My name is Beth Massey and welcome to the Windows forms of her data video series and its next video work I talk about how we can create auto complete functionality on combo boxes and text boxes anytime we re creating controls that are likely to take on repeated or predictable values you should consider providing auto complete functionality for your users so we been creating an application called the order manager and I have that open now I created a new form ads is called a form seven so what to do first is demonstrate some of its thick functionality is I m going to just drank some controls on to this format created and that s the combo box and the text box and we can inspect some of these new properties and from the property sheet here so let s take a look auto complete sewer custom source auto complete mode
Minute 1
Auto complete source are the three properties that control what s inside and how the auto completion works so auto complete mode we have a choice of suggests append or suggest a tent in what I mean to suggest means it s going to drop down just like here as we type some suggestions but it s not a force that suggestion on us on the Texan retyping opinion means it s going to actually append right into the text box me suggestions that it s made in an suggest intended means that the show if there s multiple suggestions ill show multiple ones in the list and ask a federal append the first one in the West selects take a look at suggested hand and for the Solaris out of the box we have some choices we have are filesystem a history list are recently used list any of their roles or system resources we can just use filesystem directories or we can choose custom source
Minute 2
It will take a look at a custom sources and a little bit mom and we have listed items here and list items needed if we have this combo box bound to a data source at it we can choose from the data source it s down to an awesome example that you suffered Islamists is to use recently used less and for the text box will just make this an apparent mode and I ll choose all our olds okay so let s take a look at how this reacts when we type in F5 and now when I type MSDN you ll see that it s appending and suggesting sites that I visit it thanks and now the text box you ll see that it is not suggesting his reset it to just depend a thanks so that s not a complete works
Minute 3
Somali one and look this up to some data so what can it do is I m going to show you a form that a party started form six year and this is just a product description editor I ve got a product data set that I created it just has one table in a product and his little form allows us to scroll through the products as we flipped through this combo box and edit their descriptions so let s just run this to see how it works so that F5 and this will load up the products that we have here and as we scroll through we can edit the descriptions in the box can t attack so what I want to do it I want to add auto complete functionality to this drop down here that we do that so what we do is we sent up be data binding mode on the combo
Minute 4
Ox first so I did is I just drag the product table onto my combo box it automatically set up the data source is displayed member here so the product fighting sources are data source said that we want to set up the auto complete to display only what s inside our product fighting SARS the first of set to auto complete mode to suggest and the auto complete source will then be list items to list items means that it will display within product binding source select F5 to test this annual see now that if I title are you out of a list of the oranges juice and the Oreos which is exactly what it should be quite tight AEI only have one product Apple s great sin ago over exactly what he customs source is still a
Minute 5
Patting the list items as our source work in the select custom source instead and now I m in a deal in time to go into them some code and where to specify a custom source select custom source really is it it s just a string collection of values so her to want to create a string collection of values let s just used to say all the oh products just for this example so I m it had some code to the load event you create oh products as new auto complete string collection tank so what I m into his undisguised day for each product as product data set
Minute 6
In our product data set and then if it started out where at products 20 products gay silly buildup of auto complete string collection and then we just have to set this to the combo boxes out of complete custom source of a select set hit F5 and see if this works so now
Minute 7
When I type in DER are for a eye don t get any of those suggestions but I think I ll go see I get orange juice and Oreos to lose the only things that it s going to be suggesting for me I can still use the drop down aggressive that s how we can create auto completion for users of their typing and retake repetitive values that it s always good to give them some sort of auto complete so that it s easier and faster for them to enter data into their controls rights so I d like to thank you for your time if you like to check out the Visual Basic developer Center will be posting updates these videos there please also check out the Visual Basic team blog and my blog for more information basic
Sunday, May 25, 2008
Video: How Do I: Use Auto-Complete?
Labels:
autocomplete
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment