Hello,
we are using infra. UltraPopupControlContainer to display popups. The popup should be closed when user leaves particular control with tab key, or clicks with mouse to do another action.
The problem is as following: the mouse click gets "eaten" by the container and is not propagated further. Do you know how to fix something like that?
Thanks
Peter
Hi Peter,
The Popup should automatically close if it's on a standard DotNet form and you have full trust for your application.
Is this a WinForms applications? Are you using an unusual container of some kind?
it is winforms app, no non standard container
I display the popup on someControl.Enter event and close the popup on someControl.Leave event.
The scenario I'm talking about is that you enter the control and popup is displayed, then you grab your mouse and click somewhere on the form (for example on the button). The popup is dismissed properly (a good thing), but the click doesn't travel further so the button underneath doesn't get clicked.
I don't think you have to close the popup in the leave event. Any click that is outside of the popup should close it automatically, I think.
But anyway, I guess I misunderstood the question. I don't think there's any way to do that. I'm pretty sure this is a standard of DotNet. The first click closes any open popup windows. You will get the same behavior with any popup, like a ComboBox, for example, unless I am mistaken.
I have the same problem.
I use the code below to close the pop up after a few seconds of sleep.
ultraPopupControlContainer1.Close();
The pop up closes correctly but it requires 2 clicks for clicking on anything else on the form after, the first click is not responsive (thinking the pop up is still open).
any work around for this to forcing the pop up to really close. I even try to set the focus on another button.
thanks
Found the solution, my problem was that the .Close() was not called from the same thread. Here is the code for really closing the control.
private Thread LiveUpdateThread = null;delegate void SetControlsCallback(object obj);
private void someevent() { try { //some code here
this.LiveUpdateThread = new Thread(this.ThreadProcSafeRemoveWait); //close after 4 seconds this.LiveUpdateThread.Start(4000); dlgShowReportSelection.ShowDialog(this); } catch (Exception ex) { } } private void ThreadProcSafeRemoveWait(object obj) { this.SetLiveWait(obj); } private void SetLiveWait(object obj) { try { if (this.pnlPleaseWait.InvokeRequired) { SetControlsCallback d = new SetControlsCallback(SetLiveWait); this.Invoke(d, new object[] { obj }); } else { Thread.Sleep(Convert.ToInt32(obj)); ultraPopupControlContainer1.Close(); } } catch (Exception ex) { } }