views:

483

answers:

1

When the WPF ComboBox is clicked and in-focus, the only interaction that occurs after that can be with the ComboBox. If anything else is interacted with, including the window functions (minimize, restore, close, resize) and any control in the window, the action is ignored and the ComboBox loses focus.

In addition, MouseEnter and MouseLeave on the window buttons are still active, but when MouseEnter on the window border(?) occurs, the mouse pointer does not change to the resize pointer. This behavior makes sense because of the ComboBox's use of the popup control. The popup control exists independently of the main visual tree and if i.e. the window moves or gets resized, the popup remains fixed floating above the main window.

I have tried using Reflector, to see what the ComboBox is doing, but I have not been able to find what I am looking for. Basically, I do not know if this behavior is coming from the window, the ComboBox, or if it has something to do with the popup. How can I solve this problem?

+1  A: 

You're right on in your description there, the popup keeps all action focus until it itself loses focus. If you're trying to change the functionality of the ComboBox you may want to look at creating your own ControlTemplate that behaves differently and does not keep the default action of the popup control.

Hope this helps, not entirely sure what you're trying to do.

Jeff Wain
I am not trying to change the functionality of the combo box I'm trying to create an entirely different control that is structured like the combobox control template, only without the toggle button. If you look at the ComboBox you can see that while the popup is open, any mouse event seems to pass through. It even ignores the hovering the window border where the resize pointer would normally show. I know they do this so that the popup cannot get left open when the window is changing. I am just trying to figure out how to accomplish similar behavior.
BrandonS
In that case I would probably ditch the drop-down idea of the ComboBox and just create a control that displays content when toggled. Then you can set it to close the content panel when mouse focus is lost. You would have to duplicate the functionality of the ComboBox itself but probably can only achieve the behavior you want by doing that.
Jeff Wain