key board event on dropdown combobox mfc - combobox

How to handle delete key on dropdown of combobox which is created with style CBS_DROPDOWNLIST?
I want to delete the items in the dropdow list when user presses delete key. Please someone explain how to handle this on a combobox.

Either use PreTranslateMessage in the parent dialog to fetch the VK_DELETE key. Or subclass the list control when the combo box drops down.
You can get the handle of the list control with GetComboBoxInfo

Related

Where is the Visual Basic 6 Combo Box Click Event?

I'm new to Visual Basic, I have scoured the net to look for the event handler for the combo box click event but I cannot locate it. I am trying to make an event happens if a certain index is selected with the combo box1 then another combo box2 will populate the selected the index.
i have looked at links like these but it does not explain how or what the person did to access the _ click event VB6 Combo box events
In the code window for the form, select the desired control from the left drop down, then the event you want from the list of all events in the right drop down:
It will create the procedure for you and make it the active one. This is the same as VB.NET assuming you have the selectors on.
I haven't been using VB6 for ages, but i think what you need is covered here: http://www.vb6.us/tutorials/visual-basic-combo-box-tutorial
I cannot recall having to do anything special when using click events in VB6 at all.
In the first combobox click event, you should be able to have an if statement checking if a certain item is selected using .ListIndex and if so, populate the other.

Multi select treeview that supports drag of multiple Items in WPF

I was searching for possible solution for hours and could not find any.
Hopefully someone can help me.
I managed to implement Multi Select WPF TreeView using the following answer: https://stackoverflow.com/a/6681993/1679059
It works nicely but I want to be able to drag selected items and drop them into the DataGrid.
In PreviewMouseMove event handler previously selected items get deselected so I can't prevent that from happening.
I was trying to prevent deselecting items in PreviewMouseLeftButtonDown event handler but at that point I cannot know if a user intends to select an item or drag selected items.
Can someone help me with that problem?
you can do this by adding a bool variable let say 'isLeftClick' in MouseLeftButton Event change isLeftClick to 'TRUE' and in MouseMove event check if isLeftClick is true or false if it is true then user thn user is trying to drag.
also check if mouse is pointed on one of selected nodes thn drag those nodes if it is on some unselected node then select that node and drag it.

Not selecting item in combobox

I need the following behavior for WPF Combobox:
i need autofilter in combobox. Took the implementation from here. But when there are several items in dropdown that are almost same-when i press DOWN it just selects the first one from list and hides others(see video of current behavior here: http://www.youtube.com/watch?v=_WYAgMTxc4M). If i want the second possible-i have to select it with mouse or write down the whole item display name in editable part of combobox. Is it possible to select item without changing editable part of the combobox, until i press ENTER, for example?
I think that problem is when you select the item, it fill the text area of ComboBox, than it notify that filter text changed and it applied new filter for the list, and the only one item remains in the list.
You should to rewrite this behavior that will apply filter only if KeyPressed / KeyDown / KeyUp events was fired.

Prevent Treeview Selection in Silverlight

I have two panes in my page (category and items). The category pane is basically a n-level tree view which controls what items are to be shown on the items pane on the right. So if I choose a category, the items panel on the right hand side will show all items in that particular category (in a datagrid). I am fetching the items from a WCF service in the SelectedItemChanged event.
Now the items grid in the right pane is an editable datagrid. So when a user has some unsaved changes in the grid and tries to change the category, I need to give him a warning message (message box with Ok/Cancel) and on cancel click, I need to suppress this category selection change.
Now, I have tried the the MouseLeftButtonDown event to suppress this, but it somehow doesn't seem to work.
I have refereed this link for the possible solutions.
Can anyone please suggest something?
At the end of your selectedItemChanged event, call [yourTreeView].ClearSelection()
This will give the appearance of the treeview not performing a selection, yet will react as a click.

silverlight combobox - highlight a few items in the popup list

I'm wondering if I can make fake sections in the popup menu:
The rule would be, if the 5th character of the displayed item is different from the 5th char of the previous item in the menu, it has to be highlighted
What do you think?
Thanks!
To achieve this would be a hack.
Normally the items that appear in the popup part of a combo box will be an instantiated data template, and each gets its own data item and has no clue or knowledge of the other items in the list, so you couldn't use a converter or anything else to achieve this behavior.
What you could do though is inject (attach) your own control into the popup part of the combo box, and take over the rendering of the data items. How you do this will depend upon which combo box you are using (i.e. MS or some other vendor's) and would be a whole new question.
Would that be easier if I were to create my own combobox as follow:
a TextBox associated with a Button that when pushed would popup a datagrid in which I could implement this conditional formatting?

Resources