Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | Videos | Photos | Blogs | Beginners | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
6 Months Free & No Setup Fees ASP.NET Hosting!
Search :       Advanced Search »
Home » WPF » WPF AutoCompleteTextBox in VB.NET

WPF AutoCompleteTextBox in VB.NET

In this article I am going to show about AutoCompleteTextBox in WPF.

Author Rank :
Page Views : 4406
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 


HTML clipboard

In this article I am going to show AutoCompleteTextBox in WPF. AutoCompleteTextBox mean when we type something to search in a textbox to get a small list of valid search results that match the search string entered so far. In this article I am using Linq to Sql also. I have saved my DataBase inside DATA folder. To run the application just add this database and change connection string from setting inside properties folder.

See in this image.

WTImg2.JPG
 

Image 1.

Just change here DataSource according to you server name.

This is my DataTable from which records are coming.

WTImg1.JPG
 

Image 2.

This is my XAML code.

<Window x:Class="AutoCompleteTextBoxInWPF.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="250" Width="350">

    <Grid Background="AliceBlue">

        <Grid.RowDefinitions>

            <RowDefinition Height="40" />

            <RowDefinition Height="203" />

        </Grid.RowDefinitions>

        <TextBlock Text="Search :" HorizontalAlignment="Left"

                   VerticalAlignment="Bottom" Width="70" Height="15.96" Margin="31,0,0,4" />

        <TextBox HorizontalAlignment="Right" VerticalAlignment="Bottom"

                 Height="25" Width="160" Margin="0,0,10,0" x:Name="txtName" TextWrapping="NoWrap" SelectionChanged="txtName_SelectionChanged" />

        <ListBox x:Name="listName" SelectionChanged="listName_SelectionChanged"

            Background="LightCyan" Grid.Row="1" Visibility="Collapsed"

                 HorizontalAlignment="Right" VerticalAlignment="Top" Width="160" Margin="0,0,10,0"/>

    </Grid>

</Window>

 

When we run the application and want to search name which start with "R".

WTImg3.JPG
 

Image 3.

If we type character "E", then the textbox will show all names starting with this character.

WTImg4.JPG
 

Image 4.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Rahul Kumar Saxena
Rahul shows great interests in working with Microsoft technologies. He specializes in the implementation of DataBase & Graphics. His area of expertise includes: C#, ASP.NET,ADO.NET,Windows Forms & Web Services. He hails from background , Master's in Computer Application. With programming he loves photography, traveling and reading books.
(Talabpur*)
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the top 5 tips for understanding .NET
Ricky Leeks presents the top 5 tips for understanding .NET Interoperability. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments
what to write for textbox _ textchange event or textbox event in C# ? by naveen On September 6, 2010
Hi Mr.Rahul,
what is the back- end code we have write for this auto complete textbox. ?
also under which event we have to write c# code for making this work.?

thanks in advance

Naveen...
Reply | Email | Modify 
Team Foundation Server Hosting
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.