First of all, this is probably the wrong forum, but I can't find a suitable one for this problem.
I have a button which shows a drop down panel using DropDownManager.DropDown(). On that panel there is another button which opens a form. The problem is, when I open that form the drop down panel closes. I want this panel to stay opened while the form is shown. I have fixed this issue by using DropDownManager.SuspendAutoCloseUp. But this creates a new problem. The popup form contains an UltraComboEditor. This combo won't close by clicking anywhere in the form. Furthermore, when moving the popup form while the combo box is openend, the dropped down list stays in the same place on the screen.
I added a small sample project demonstrating the problem. Both buttons do the same, except one calls SuspendAutoCloseUp before opening the forum. I hope someone can help me achieve the following:
- A dropped down panel should stay open when a popup form is opened- Combo boxes on this form should retain default functionality (ie clicking outside the combo box will close it up)
I'm using version 10.3.20103.2145. Thanks in advance.
Hi,
The problem is the Owner you are specifying when you show the dialog. You are calling:
frm.ShowDialog(this);
So the dialog is shown as a child of the main form. This means that the popup window no longer has focus and the active window is owned by the main form and not the popup. If you change it to be a child of the dropdown panel, it works fine:
frm.ShowDialog(this.pnlDropDown);
Hi Mike,
Thanks for your solution. However, another problem remains which I forgot to mention. When the popup form is shown, and you switch to another program, both the drop down panel and the popup form are closed. That's the reason I experimented with the SuspendAutoCloseUp method. Do you have a solution for this?
I don't see any way around that. That's pretty standard behavior for any popup window. It sounds like you are trying to do something very unusual here, so you might want to consider if you really want to depart from Windows standards like that. It might confuse your users.
What you are doing kind've sounds a little like what happens with floating toolbars, though. So maybe you really just need a floating child dialog instead of using a DropDown.
Although it may not be standard, I think the user would expect at least the popup to stay visible.
However, it seems to work when I specify no owner at all in ShowDialog. I can remember that a certain dialog form was always hidden behind the main application, and since then I've specified 'this' as the owner of dialog forms. Hopefully, this dialog won't get hidden.