Category / Section
How to align a popup to a ParentControl in a form
1 min read
Make sure to set the ParentControl property. Note that this will make the corresponding control a "popup parent", not the ParentControl (Control.Parent property). Making a control a "popup parent" will not hide the popup when the user clicks on it.
C#
// Let the popup align around the source textBox.
this.popupControlContainer1.ParentControl = this.sourceTextBox;
// Passing Point.Empty will align it automatically around the above ParentControl.
this.popupControlContainer1.ShowPopup(Point.Empty);