We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Keeping popup box open

How can I keep the popup box open until the user clicks the enter key? I am using the popupcontrol container and I need to override the normal behavior so that the popup only closes when the enter key or the ok button is pressed. The users want the information in the popup box to be visible when they switch between applications.

3 Replies

AD Administrator Syncfusion Team May 2, 2005 03:17 PM UTC

Hi Greg, Setting PopupControlContainer.IgnoreMouseMessages to true should provide the behavior you described. Regards, Gregory Austin Syncfusion Inc.


GS Greg Shomette May 2, 2005 07:56 PM UTC

Hi Gregory, I had already tried the IgnoreMouseMessages and that works fine as long as I stay within the application; however, when I switch to another application the popup goes away. The users want to be able to switch between applications without the popup dissappearing. I do not know if this is possible or not. >Hi Greg, > > Setting PopupControlContainer.IgnoreMouseMessages to true should provide the behavior you described. > >Regards, >Gregory Austin >Syncfusion Inc.


AD Administrator Syncfusion Team May 2, 2005 08:35 PM UTC

Hi Greg, The best way to keep the popup open would be to handle the Form''s Deactivate event and call Show() on the PopupControlContainer. Calling Show will cause the control to be shown without any of the automatic closing behavior built into ShowPopup. The following code snippet demonstrates this: bool isPopupUp; //You need to set popupLoc yourself whenever you call ShowPopup Point popupLoc; private void Form1_Deactivate(object sender, System.EventArgs e) { this.isPopupUp = this.popupControlContainer1.IsShowing(); if (this.isPopupUp) { this.popupControlContainer1.Show(); } } private void Form1_Activated(object sender, System.EventArgs e) { if (this.isPopupUp) { this.popupControlContainer1.Hide(); this.popupControlContainer1.ShowPopup(this.popupLoc); } this.isPopupUp = false; } This solution does have the drawback of drawing the Popup over other windows, but it will stay open while the Form doesn''t have focus. Please let me know if you have any further questions on this topic. Regards, Gregory Austin Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon