1

I just want to do the following in .net 4.0 wpf windows application.

var source = new AutoCompleteStringCollection();
source.AddRange(Contract_Extracter.GlobalVariables.customerList);
textBoxClientID.AutoCompleteCustomSource = source;
textBoxClientID.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textBoxClientID.AutoCompleteSource = AutoCompleteSource.CustomSource;

and I'm getting following errors,

  1. The type or namespace name AutoCompleteStringCollection could not be found (are you missing a using directive or an assembly reference?)

  2. System.Windows.Controls.TextBox does not contain a definition for AutoCompleteCustomSource and no extension method AutoCompleteCustomSource accepting a first argument of type 'System.Windows.Controls.TextBox' could be found (are you missing a using directive or an assembly reference?)

3.The name AutoCompleteSource does not exist in the current context

I have already added using System.Windows and the reference. What is wrong here? what are the assemblies should I refer?

Thanks

Anatoliy Nikolaev
  • 22,370
  • 15
  • 69
  • 68
Sri
  • 283
  • 2
  • 6
  • 15
  • 1
    Auto completion is a feature of the [WinForms TextBox](http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.autocompletemode.aspx). It is apparently not available in WPF, but you can find one in [this toolkit](http://wpf.codeplex.com/releases/view/40535). See also [this question](http://stackoverflow.com/q/950770/1136211). – Clemens Dec 18 '12 at 13:56

0 Answers0