Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a "word-by-word" autocomplete in WPF?

Tags:

c#

wpf

I already did some research and ended up with several autocomplete boxes which have one thing in common: they all match the whole expression which has been entered. Sometimes, they seem to be easily expandable, but at the end, they aren't.

However, I need a Textbox which allows the user to enter a word (e.g. "tag1"), displays a popup with some suggestions based on this single word, accept the suggestion with the return key and type in a new word (e.g "tag1 tag2") in the same textbox, with the popup popping up again. (I like the way CintaNotes handles this)

I need this for a tagging interface. It's often faster for the user to write the tags into a simple box, but sometimes, he needs assistance. This is what the autocomplete is for.

I've found some results, which don't work for my purpose (imho):

  • http://www.wpfpedia.com/item/details/743/wpf-autocomplete-textbox-control
  • http://www.codeproject.com/KB/WPF/WPF_Autocomplete.aspx
  • http://www.codeproject.com/KB/WPF/autocomplete_textbox.aspx
  • http://weblogs.thinktecture.com/cnagel/2011/01/autocomplete-textbox-with-wpf.html

Btw, I really like the way the Tag-Box for SO operates.

Does anyone have an idea? Is there a "out-of-the-box" - solution somewhere, which suits my needs but I didn't find? Or do I have to build one myself?

Thanks! :)

like image 821
Daniel Gilbert Avatar asked Nov 11 '11 22:11

Daniel Gilbert


1 Answers

I think you mean a textbox which autocomplete for multiple words. Like TokenizedTexbox on WPF Extended Toolkit. this is the page: http://wpftoolkit.codeplex.com/wikipage?title=TokenizedTextBox&referringTitle=Home

like image 63
jcvegan Avatar answered Nov 16 '22 11:11

jcvegan