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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there a way for the PopupContainerControl to work without the parent control getting deactivated?

 

Our PopupControlContainer acts as a separate container and hence the main form loses its focus when controls inside Container receives focus.One way to overcome this is to display the PopupControlContainer using Show() method than using ShowPopup() method.

In ShowPopup method,when you specify a Parent Control using ParentControl property and pass a Point.Empty location , the popup location will be dynamically determined based on the ParentControls bounds and the screen area.Inorder to get the same behaviour while using Show() method,you need to determine the popup location manually as shown below.

C#

Point point=this.popupControlContainer1.ParentControl.Location;

point.Y=point.Y +this.popupControlContainer1.ParentControl.Height ;

popupControlContainer1.Location=point;

this.popupControlContainer1.Show ();

VB

Dim point As Point=Me.popupControlContainer1.ParentControl.Location

point.Y=point.Y +Me.popupControlContainer1.ParentControl.Height

popupControlContainer1.Location=point

Me.popupControlContainer1.Show ()

Also for closing the PopupControlContainer,you can check the visibility of the control in Form's Click Event.

C#

private void Form1_Click(object sender, System.EventArgs e)

{

if(this.popupControlContainer1.Visible ==true)

{

this.popupControlContainer1.Visible =false;

}

}

VB

Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click

If Me.popupControlContainer1.Visible =True Then

Me.popupControlContainer1.Visible =False

End If

End Sub

Article ID: Published Date: Last Revised Date: Platform: Control:
1356 04/30/2011 07/10/2014 WinForms PopupControlContainer
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon