In WPF, is there any way to Scroll Up and Down using Keyboard arrow in ComboBox list items?
Related
I try to activate a combobox control from a textbox control in c#. I want to select combobox items by using arrow keys, but they are only selectable by mouse.
Any help? Thanks.
Given a WPF ListBox with a vertical scrollbar that uses databinding, is there a way to get it to not scroll when items are added to the bound collection?
Use case: User is scrolled down the list to an item and is reading it. New item is added to the head of the bound collection. Listbox should not scroll or otherwise "jump".
Currently, when I add an item to the head of the collection, the listbox scrolls the text down one item.
I want to modify silverlight combobox behavior. I want to open dropdown by mouse entering to combobox but not clicking, that iseasy to do when handling MouseEnter event and seting IsDropDownOpen property to true. But the issue is how to close dropdown when mouse leaves dropdown area and combo itself. Any suggestions.
Thanks.
My suggestion is that you use Expander from Silverlight Toolkit with ItemsControl
Video: http://www.silverlight.net/learn/creating-ui/control-basics/silverlight-toolkit-creating-a-toolkit-expander
I've got a WPF window where I have a column of buttons on the left side. On the right side I am show/hiding UserControls as the left hand buttons are clicked.
I have created the UserControls once and then just switch between them with the buttons. As I switch I would like to retain the keyboard focus where it was when that UserControl was last visible.
In other words, I click on button A and show UserControl A. If I move keyboard focus to a textbox in that UserControl then click button B, do some work, then click button A again I would like focus to be on the same textbox that I last used in UserControl A.
Any ideas on how I accomplish this?
Declare a dictionary with the key being one the left-side buttons and the value the currently focused control. When a button is clicked, get the currently focused element and set it in the dictionary (with the key being the previously clicked button). Change the displayed UserControl and read the dictionary with the key being the just-clicked button. If there is a control for this entry, set the focus to it.
Use FocusManager.FocusedElement to know which control has the focus (actually an IInputElement, which should be the type of the dictionary value) and FocusManager.SetFocusedElement to put the focus back (or call Focus() on the control).
I have implemented drag and drop in a ListView in my WPF application. Items can be dragged and dropped inside the ListView, and also into a TreeView that is beside the ListView.
Currently, I have it set up so that when you drag to the bottom of the ListView, it automatically scrolls down the list.
What I'd like to know is if there's any way to be able to scroll through the ListView with the mouse wheel while I'm dragging its items? It seems like the mouse wheel events aren't being fired while I'm dragging.
create (and start) mouse hook helper before DragDrop.DoDragDrop(...)
analyze mouse wheel (+ check if mouse over control)
stop (dispose) mouse hook helper after DoDragDrop() operation
Note: always stop mouse hook helper, because it can freeze application when it dispose on Window close (I see it on XP).
here you can find one MouseHook, adopt it (I found bug:)) or something like it.