In a wxpython Combobox, long strings get left-truncated in the dropdown portion. This can result in some values looking identical when they aren't. I'd like to provide better information to the user than that.
The following options occur to me:
Insert elipses in the middle of the string before adding it to the combobox's dropdown choices and expanding it back before placing back in the edit portion.
Show a tooltip of the full string when the user mouses/hovers over a value in the dropdown.
Problem is, the Combobox class does not expose events that enable either of the above.
How can I intercept the events corresponding to either of the above? Any other ideas for making long combobox strings visible to the user?
Thanks,
RichK
I would recommend using the ComboCtrl instead of the ComboBox. The benefit is that the ComboCtrl is a custom widget, so it allows more flexibility. For example, the ComboCtrl provides a scrollbar for long strings. Check out the wxPython demo for some good examples.
Related
I'm currently using the Extended WPF Toolkit and from that i'm using the Propertybox. This box displays all properties of a bound element. While this works great, there is one problem. I'm using Nullable... so it does not display this enum correctly (it just gives a textbox). If i changed the enum to a normal enum (not nullable), then it displays the items correctly in a combobox.
To solve this, i tried the IItemsSource interface as described in the documentation, but this won't allow me to add a "null" value either.
I know i could solve this by adding a fake "null" value to my enumlist, but i would like to avoid this. Does anyone here know how i could make my nullable display correctly?
Kind regards
Tom
Control documentation:
https://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid
UPDATE SOLUTION:
I "solved" it by using a different control. http://www.codeproject.com/Articles/87715/Native-WPF-4-PropertyGrid. This grid supports it out of the box.
SOLUTION: I "solved" it by using a different control. https://github.com/xceedsoftware/wpftoolkit. This grid supports Nullable out of the box, and has some filtering functions for the properties you want to display that are not included in the Community Edition of the WPF Toolkit.
Update 2020: Added link to current webpage.
I have an editable combo-box where the user could select (or type) one of the values from the drop-down, or a different value altogether.
I need the autocomplete functionality, which is essentially showing a subset of values in the drop-down when one or more characters are entered.
I see there is an autocompletemode property in system.windows.forms.combobox, which would have probably served my purpose but, is there an equivalent in WPF system.windows.controls.combobox?
The WPF Toolkit Autocomplete Box is what you need. This tutorial should get you started.
I have an msoControlComboBox item in an Outlook 2007 command bar. I am able to add items to the combo box dropdown, and if the user types something in the textbox that matches the beginning of any words in the dropdown, then the combobox suggests the rest of the word, inside the text box.
I would like to do a little better than that.
I would like to be able to detect keypress events, and add/remove items from the dropdown list based on the characters the user has entered so far.
I would also like to be able to dropdown the list programatically (right now the only to drop it down appears for the user to click on the dropdown arrow).
Is there a way to accomplish these two objectives (in c#).
There is no out of the box microsoft control that can do it.
You aren't the first person to want this however and I personally used a control found here and found it to be a good starting point for my needs. It's aimed at finding in email addresses but it can be adapted to other needs. It uses regexp searches to find matches
I have a strange problem with a listbox. I added only the listbox and a button which adds items to the listbox. If I click an item in the listbox it seems to have some strange multi selection mode on or something... i recorded a short screen cast, see for your self:
http://www.youtube.com/watch?v=zV4424ipNEA
any ideas whats wrong?
That is a known issue, as all those strings are the same the selection gets confused because they all are essentially the same object. If you create two identical strings in .NET it does not necessarily create a new one but may reuse the first instance, i am not an expert on this though.
Either wrap the strings in a class (make them the Content of a ListBoxItem for example) or make sure the values are unique.
I am trying to create an autocomplete textbox in WPF. What i found is http://weblogs.asp.net/okloeten/archive/2007/11/12/5088649.aspx. It seems quite close to what i needed. The only thing missing in this is when i press down arrow key after typing some characters it does not allow to me select an item from the narrowed list in dropdown.
Please give me some pointers how can i allow to select item using up/down keys after filtering list using some text input.
Regards.
There have been many implementations already for an autocompletebox. So as swiszcz stated, look for a working & well documented project. You need not spend time on trying to tweak some particular code for too long, when other options are available.
I have used an AutoCompleteBox implementation by Aviad P for many projects and found it easy enough to tweak and suite my needs. I feel the code is well documentated in the blog article itself. Also it uses a textbox & listbox (rather than a combobox) which is in my opinion, a better choice.