MFC ComboBox dropdown list doesn't highlight the selected item - c++

I have an issue with the comboBox dropdown list. When I have similar items for example "R20 SysHealth" and "R20" in my list. When "R20" is the selected text and I click to show the dropdown list it hightlights the "R20 SysHealth" instead of "R20" so its not comparing the exact string. Has anyone come across this before? if not can you turn of the highlighting?

You might want to use the FindStringExact member method of CComboBox instead of just FindString.

Related

How can I assign different selection modes?

I have default QTableView.
I want to get following selection behaviour:
If we selecting cells, selection will work like if we accepted SelectionMode::ContiguousSelection
If we selecting rows/column by clicking on QHeaderView section, selection will work like we accepted SelectionMode::ExtendedSelection, but deselect all cells, if any were selected.
I tried set SelectionMode to headers in QTableView constructor, but it doesn't work.
Question is how can I do it properly?
Okay, got it.
All I had to do is just make custom selection model and handle everything in there. But I had to change SelectionMode::ContiguousSelectionto SelectionMode::ExtendedSelection in my view to get meaningful indexes in my selection model.

Tkinter - Changing the list in Option Menu

Is there a way to manipulate the List displayed by the OptionMenu in respect to what the user has currently selected?
For example, let's say I have a list - ["A","B","C"].
If the user currently selected A then if he clicks the optionmenu with A currently selected, what he will see in the list is not the original list but only B and C.
If he switches his answer from, let's say, A to B, then now, he will only see A and C in the OptionMenu.
And the same will follow if he chose B or C.
Thanks!
The OptionMenu widget is a button that shows a dropdown menu when pressed. You might do better to use a ttk.Combobox instead as that is a more modern UI element and you can very simply configure the values configuration item.
You can configure the attached menu at runtime. You access the menu using optionmenu['menu'] and you can then query items on the menu optionmenu['menu'].entrycget(0, 'label') or use entryconfigure to modify the items. Or you can delete items optionmenu['menu'].delete(index) and add new items. See the menu documentation for hints on manipulating the menu entries.

MFC combobox dropdown/drop list: displaying only one item

I've got several comboboxes which has approx. 40 items in each of them and no matter what I've tried to set in the VS 2013 comboxbox parameter box, it still shows only one item at time. I want to show several items at one time (doesn't matter if there will be vertical scrollbar or not) right now it looks like this
http://imgur.com/qU2UVrL
thank you for possible ideas.
mk
You can change combo-box expansion area directly in dialog editor: http://msdn.microsoft.com/en-us/library/4cta1x1t.aspx

AutoSuggestion in Combobox

I created a Combobox with CreateWindowEx. Everything goes well. But I would like to make a final feature: AutoSuggestion. The Combobox is used to do search text in a document, hence at some point, it have items that are the strings a user searched. The AutoSuggestion should be: drop down the list of items, find those items that begin with the string that a user typed in the edit control, but do not select one of them, do not display all other items, and finally do not change select item when keydown or keyup occurs, only highlight the item and select only when a user press Enter. Do you have any idea how to accomplish this task?
It sounds like you want Autocomplete functionality.

ComboBox changes text when dropped down

I have ComboBox (DropDown one) with 2 items in it ("One", "Onion"). When I type 'on' in combo and push dropdown arrow then the text i wrote automatically changes (item "One" is highlighted in list and text changes to "One").
How to prevent it?
I'm not entirely sure how you want it to behave since you don't actually specify, but there are three kinds of ComboBox types: Simple, Dropdown, or Drop List. These each have different behaviors as well. I would suggest you play with the different types first and see if you find what you are looking for. You will find this setting in the properties under Type.
I believe you are currently using Dropdown. Changing it to Drop List should make it so that you can only type something that's in the ComboBox. IE: In your example they can only type One or Onion and it will auto complete to whichever is most similar.