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.
Unfortunately, activation email could not send to your email. Please try again.

How to make the popup resizable?

 

Set the FormBorderStyle of the PopupControlContainer’s parent form to the appropriate style.

Do that in the PopupControlContainer’s BeforePopup event handler. You have to do this as late as in the BeforePopup event handler because this is the earliest the PopupHost will be non-NULL.

C#

private void colorUIPopup_BeforePopup(object sender, System.ComponentModel.CancelEventArgs e)

{

    // Make the popup host's border style resizable.

    this.colorUIPopup.PopupHost.FormBorderStyle = FormBorderStyle.SizableToolWindow;

    this.colorUIPopup.PopupHost.BackColor = this.BackColor;

   // Necessary to set the host's client size every time, especially since the popup's Dock style is set to DockStyle.Fill.

   if(this.colorUIPopup.PopupHost.Size.Width < 160)     this.coloruipopup.popuphost.size = new system.drawing.size(160, 176);

   // so that the popup container will fill the entire popup host when resized.

   this.coloruipopup.dock = dockstyle.fill;

}

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

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.