wpf windows disappear when popup opened - wpf

first picture -before click the combobox
As the first picture shows,I have a child window which has lots of comboboxs.
second picture -after click the combobox
Once I click the combobox and the combobox popup opened,then the child window will disappear, as the second picture shows.
In my opinion,the child window behaviors like come behind the mainwindow, like its zindex has changed.
Can anyboby has a clue,thanks a lot.

Related

Binding textbox from one WPF window to another

I am unsure on how to bind the text in a textbox from one WPF window to another textbox in another window.
The premise is basically when I click the button on one WPF window after entering data in the textbox in that window, it should be visible in the WPF window which is being opened.
I would appreciate if someone could point me in the right direction :)

WPF combobox in a dialog window - can not select items falling beyond height of window

I have a dialog window in WPF with a ComboBox. When the ComboBox items are more, they show beyond the height of the parent dialog window (in open state).
I am not able to select these items with the mouse (which are falling outside parent dialog window).
One possible solution is to increase height of the parent dialog window, but it doesn't look good.
Can someone help?
Try setting MaxDropDownHeightof your ComboBox
<ComboBox MaxDropDownHeight="100" />

ComboBox doesn't raise keyboard and mouse events as expected

I use Silverlight 4.0 and have got problems with ComboBox control. I want to implement a popup menu which will show and hide itself without clicking mouse. It should show when I place cursor on its region - this prt works well. Then it should hide whenever mouse pointer is placed outside of its region for a while. I implemented it with MouseEnter and MouseLeave events. My problem is ComboBox - this control behaves weirdly, in my opinion. Normally I would expect it to raise MouseEnter event when I put the cursor on it and MouseLeave when I put the mouse cursor anywhere else. The real situation is different: Whenever I click the combobox, it opens and shows the list of options, and immediately sends LostFocus and MouseLeave events. So it seems like the control lost keyboard focus and mouse pointer has been moved out of its region, while actually the combobox list of optins is open and active and has keyboard focus in it.
So the question is how can I know in my program what is happening in comboboxes? In order to correctly hide my popup menu, I need to know when the list of options in a combobox is open or closed. I can't see any events for this or any other documentation. (Wanted behavior is: If a combobox is closed, I hide my popup menu based on the position of mouse cursor. If a combobox is open, I never hide my popup menu until user either selects something in the combobox, or closes the combobox.)
Also, if you have got a good experience with a third party combobox replacement, which looks and works similarly AND raises events I need, please let me know.
MSDN has two events listed for ComboBox that you might want to look at.
http://msdn.microsoft.com/en-us/library/system.windows.controls.combobox_events(v=VS.95).aspx
DropDownClosed Occurs when the drop-down portion of the combo box closes.
DropDownOpened Occurs when the drop-down portion of the combo box opens.

allowing clicks on Button in ComboBoxItem when IsHitTestVisible is false

alt text http://img375.imageshack.us/img375/9830/combobox.png
Setting the IsHitTestVisible="false" has the effect of having the whole ComboBox's drop area unresponsive to clicks. The same goes for setting to true.
With a ComboBox I don't have to create any storyboard to make ComboBox animation like but I found this issue.
How can one make the ComboBoxItem area unclickable except for the button within?
Sounds like you should be creating a custom control that uses a popup window, that just looks like a combobox, however you can do what you wanted:
Put your buttons inside a grid, inside a single RadComboBoxItem
Set the grid background colour to 1% alpha so it is hit-test visible yet unseen
Add a Grid_MouseLeftButtonUp event handlern to the grid
In the handler set e.Handled to true so the mouse up is eaten
Make sure you close the combobox popup when you get your button presses.
Hope this helps.

MouseOver event are missing alternately

I'm using a modified form of treeview, for the treeviewitem there is a template to show a textbox with a done button in a popup. I have used a static class to find if the mouseOver
(IInputElement currentPosition = Mouse.DirectlyOver;) event on any of the other treeview item to highlight them other than the one in Popup textbox. Items are added dynamically to this treeview. I'm using MVVM model here.
The problem is that when the first item is added and is in Popup textbox , the mouseover for the entire application is somehow turned off, which is not required. But on adding the second item and leaving it in the Popup textbox, the mouseover is switched on, i.e the treeviewitems get highlighted when mouseover occurs. this happens alternately....
What is capturing this mouseover event..??
try using snoop it can tell you what events are being raised, handled. and its a cool tool as well for the wpf man (or woman:)

Resources