none
ComboBox autocomplete stopping on a "/" error

    Question

  • I have encountered a strange error. I've got a combobox that has autocomplete set to append and has it's item list filled one at a time with several string entries, a few of which have a / in the middle of them.  If i start typing in the box and one of the list items with a / in it is matched, it will autocomplete the item, but only to the / and then it stops.  I have verified that the list items are stored correctly in the control, the text is just not getting filled out completely.

     

    Has this happened to anyone else? and is there a way to fix or work around this error consistently? 

    Friday, December 07, 2007 9:57 PM

Answers

  • As this document states:

    The operating system might limit the number of custom strings that it can display at once. For strings that contain a forward slash (/) or backward slash (\), automatic completion appends all characters only up to and including the slash.


    However, if you still want to workaround it, a candidate solution for you is to create your own ComboBox which is a UserControl contains a ComboBox and a ListBox, do not use the default autocomplete mechanism, handle the TextChanged event instead, and use a top-level form to host the ListBox, show it whenever needed. See this trick in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2220260&SiteID=1



     

    Thursday, December 13, 2007 5:30 AM