> > >
WPF AutoCompleteBox as UserControl (.dll)
Express yourself! Share your work with other members of the Expression Community.

Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.

WPF AutoCompleteBox as UserControl (.dll)

Average Rating:  (2)
Description
Discussions (5)

  • .Focus() not working?
    2 Posts | Last Post March 19, 2010
    • Hey LawBot, awesome control.  This thing has saved my bacon by giving me a very clean version of an AC text box vs some of the other samples that were out there that were a little shaky to say the least.
      
      Anyhow, I'm having problems setting the focus on my ACB.  The GotFocus and LostFocus events fire correctly, but when I call ACB.Focus(), I'm not getting focus.  Any help would be greatly appreciated.  Again, thanks for sharing this with the community and saving me a bunch of hours of dev time myself.
      
      ~Brian
    • Hey Brian,
      
      here is a quick and dirty workaround to set the focus to an ACB.
      
      Given your ACB is named "myACB" and you have a button named "btTest". A click on btTest sets the focus on myACB:
      
        Private Sub btTest_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btTest.Click
      
          Dim ob As Object = myACB.Content
          For Each child In ob.children
            If child.name = "txInput" Then
              child.focus()
              Exit For
            End If
          Next
      
        End Sub
      
      Best regards,
      M.
  • This solution is history.
    1 Posts | Last Post February 26, 2010
    • Hi Community,
      
      the February 2010 release of the WPF Toolkit includes an AutoCompleteBox.
      
      http://www.jeff.wilcox.name/2010/02/wpfautocompletebox/
      
      Download the February 2010 release at Codeplex.com:
      
      http://wpf.codeplex.com/releases/view/40535
      
      Thanks to all of you who downloaded my solution.
      
      Best regards,
      M. (LawBot)
  • UPDATE: Added dynamic repositioning
    4 Posts | Last Post December 15, 2009
    • Hi,
      
      I updated my WPF AutoCompleteBox and added the dynamic repositioning for the popup. In my first version I simply forgot that. (It was too late last night.) Sorry for that.
      
      Now an opened Popup allways stays in it's correct position under the TextBox even when the user is repositioning the application window.
      
      I hope you like it. I will coninue working on it. But now it works quit fine.
      
      Best regards,
      M. (SilverLaw)
    • Hi,
      
      question, i have downloaded ur .dll and loaded into my C# wpf 
      prject, but I failed to create a instance of your ACB class.
      
      Exception.
      
      What I have done is just ACB a = new ACB();
      
      thanks
      
      XI
    • Hi damarel-xi,
      
      please visit my blog (see above Supporting Url) and read the comments there for more information. If necessary you might post me your sourcecode on my blog if you don't find a solution there.
      
      Best regards,
      M.(LawBot)
      
    • damarel-xi,
      
      give your main application window explicitly a name in the XAML code:
      
      <Window x:Class="Window1"
      
             ...
      
             Name="mainWindow"
      
             ...
      
      </Window>
      
      
      If you do this, the error will no longer occure.
      
      Best regards,
      
      M. (LawBot)
  • Couple of questions
    2 Posts | Last Post October 20, 2009
    • I like your control and the way you packaged it up as a DLL is awesome.  I would like to use your control in my project, but there are a couple of problems:
      
      1. I noticed the TextBox chrome is different for your AutoCompleteBox... is there a way to use the default chrome?
      
      2. If the text doesn't fit in the space allotted to the control, the text wraps instead of scrolling.  Can I change this behavior so that the control will scroll horizontally rather than wrap?
      
      Suggestion: Rename MySourceList to ItemsSource... seems more WPF-ish.
      
      
      
    • Hi Zedubal,
      
      thanks for your feedback. To answer your questions:
      
      Unfortunately in the current version there is no way to use the default TextBox chrome or to change the wrap behavior.
      
      But currently I am working on the 2.0 Version and I am going to use your post as an opportunity to try to implement these features.
      
      LawBot
      
      
  • Where on Earth is the Sample?
    2 Posts | Last Post September 13, 2009
    • Do you have a .sln file that shows this in action?  I'd like to call a WCF service and get my items.
      
      Thank you,
      Michael
    • Hi Michael,
      
      the .MySourceList property holds a generic List(Of String). Use this to set/get the list itmes. Each time you set the MySourceList (List(Of String) the list will be sorted.
      
      LawBot

Details

Rate it:
 
 
 
 
 
  • Share It:
    E-mail Twitter del.icio.us Digg Facebook
  • Add To Favorites
  • Published: 8/21/2009
  • Tags: WPF AutoCompleteBox
  • License Information:
    This contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.