Tag Archives: tutorials

How to add Auto Complete to Textbox or Combobox Controls in Visual Basic 2005/2008, VB.NET 2010, and newer

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 2.83 out of 5)
 

Note: This is an article which was taken from my vbcodesource.com website and is quite old. So take that into consideration… 🙂

As you will see, adding Auto-Complete support to textbox and combobox controls has NEVER been easier than it is now in Visual Basic.NET 2005. No longer do you HAVE to use the Windows API’s to get the Auto Complete functionality.

I will assume you already have a ‘Windows Application’ based project open. You can go ahead and add a textbox control or combobox control to the form. Select the textbox and goto the properties window. (I will assume you added a textbox, but the process is the same for a combobox also. I will just refer to textbox instead of combobox.)

There are 3x properties that relate to the ‘Auto Complete’ feature. You have “AutoCompleteCustomSource”, “AutoCompleteMode” and “AutoCompleteSource”. AutoCompleteCustomSource is exactly how it sounds. You can have your own text that you want the user to be able to use when they are typing in the control. But, I am not interested in going over that property right now though. There is really nothing more to it than what I already said. 🙂

OK, the “AutoCompleteMode” property is simply how the AutoComplete text responds. Click on the “AutoCompleteMode” property and then open the dropDown list associated with it. You will see 4x ‘modes’ available. “None, “Suggest”, “Append”, and “SuggestAppend”. This property MUST be selected either “Append”, “Suggest”, or “SuggestAppend” for the AutoComplete feature to work. If you select “Suggest” mode, then ‘AutoComplete’ will display a list that matches the text that has been typed thus far that you can scroll through and choose from. If you select “Append” mode, then as you are typing, it will automatically highlight the closest match to the text thus far in the textbox/combobox control, usually in alphabetical order. Plus, while you are typing, you CAN use the ‘Up/Down’ buttons on the keyboard to scroll through the list of text that is similar to the text that was typed in the textbox control. The “SuggestAppend” mode, is of course the combination of the other 2x modes. As you are typing the text, it will highlight the first occurance of matching text while also displaying a list of all the text that matches what has been typed in the control.

The “AutoCompleteSource” property is exactly how it sounds. It is the location on the computer system to get the ‘AutoComplete’ list from. Click on that property and then click on the box to dropdown the enumerator values that are available as the source. Available values, at least on my computer are: “FileSystem”, “HistoryList”, “RecentlyUsedList”, “AllUrl”, “AllSystemSources”, “FileSystemDirectories”, “CustomSource”. Just like the “AutoCompleteMode” property, you MUST select one of these values for you to get ‘AutoComplete’ functionality. Since all of the values are self-explanatory, I will not go over them.

Just to test out the ‘AutoComplete’ feature. With a textbox control, (Or Combobox), click on the “AutoCompleteMode” property and select the “Suggest” mode. Then click on the “AutoCompleteSource” property and then select “AllUrl” as the source. Run the project, start typing in the textbox ‘www’ and you should see a list of url’s you’ve visited that start with ‘www’ popup. You can then click on one of the urls and it will put that url text in the textbox.

And thats ALL there is to it! Enjoy!

Jason

 

Free E-Book – Professional C#/VB .NET Coding Guidelines

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 3.88 out of 5)
 

This is a Free e-book that goes over many areas of improving your codes. I didn’t have to much time but I glanced over the document and he does give good advice from what I viewed. This book covers both Visual Basic.NET and Visual C# programming. It is apparently for all versions of .NET including VB 2005, VB 2008, and Visual Basic 2010. Below is what the e-book covers.


Professional C#/VB .NET Coding Guidelines

.NET Coding Guidelines is a 100+ page ebook (PDF) on naming conventions, best coding practices and patterns written by the industry expert Steven Sartain and delivered to you for Free by SubMain.

The document covers:

  • Naming Guidelines
  • Class Member Usage Guidelines
  • Guidelines for Exposing Functionality to COM
  • Error Raising & Handling Guidelines
  • Array Usage Guidelines
  • Operator Overloading Usage Guidelines
  • Guidelines for Casting Types
  • Common Design Patterns
  • Callback Function Usage
  • Time-Out Usage
  • Security in Class Libraries
  • Threading Design Guidelines
  • Formatting Standards
  • Commenting Code
  • Code Reviews
  • Additional Notes for VB .NET Developers

 


 

If your interested in getting this book, then simply go to this link for the main page and click on the download button. Have fun 🙂

Jason

How to program in VB 6.0 and Visual Basic.NET for Absolute Beginners

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.00 out of 5)
 

Although I personally recommend going straight to Visual Basic.NET if your new to VB programming, Visual Basic 6.0 is still VERY popular and even though Microsoft has killed mainstream support for VB 6, it is NOT going away any time soon.

There is a 22 Lesson Tutorial that starts at the very basics of Visual Basic programming. Teaches how to use variables, objects, functions, arrays, menu’s, file and database access and MUCH more. So if you are interested in learning VB 6, or maybe want to get a refresher, then check out the link below to get started.

Click here to view the VB 6.0 tutorial…

The VB.NET version is similar to the 6.0 version. If your brand new to .NET then click the link below to get started as an absolute beginner point of view. The tutorial list is on the right-hand side of the page.

Click here to view the .NET version tutorial…

 

Jason

Visual Basic .NET for Beginners – Course/Article

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
 

The link below is to a About.com webpage for those who are wanting to begin Visual Basic.NET. This could also be good for those moving from VB 6.0 over to the .NET Framework.


Below is a small excerpt…

This course is designed to introduce beginners to Visual Basic .NET. By “beginners”, I mean someone who has some familiarity with programming, but no experience with VB.NET. The goal for this tutorial is VB.NET – not basic programming concepts – so we won’t cover “how to program a loop.” We will write a basic VB.NET program that doesn’t assume that you already know how to write one


Click Here to Read the Article

Jason