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

Dynamic Resizing of DropDown User Control

I can get my own user control to show up and function without problem. However, I need to allow the user to resize the dropdown window during the dropped state. I do not want to use the dropdown form since it does not mind the bounds of the user''s screen. How can this be done. Just resizing the user control works if you close the dropdown and reopen it, but I need to resize dynamically. I appreciate any help. Thanks.

1 Reply

Administrator July 26, 2004 10:14 PM UTC

In the renderer.DropDownContainerShowingDropDown, set the parent form''s FormBorderStyle to sizable and subscribe to its SizedChanged event. In the renderer.DropDownContainerCloseDropDown, unsubscribe to the event. In the event handler, size both the user control and the container. // in renderer.DropDownContainerShowingDropDown Form f = (Syncfusion.Windows.Forms.PopupHost)this.DropDownContainer.Parent; f.FormBorderStyle = FormBorderStyle.Sizable; f.SizeChanged += new EventHandler(user_SizeChanged); // in renderer.DropDownContainerCloseDropDown Form f = (Syncfusion.Windows.Forms.PopupHost)this.DropDownContainer.Parent; f.SizeChanged -= new EventHandler(user_SizeChanged); //the handler private void user_SizeChanged(object sender, EventArgs e) { this.DropDownContainer.Size = this.DropDownContainer.Parent.Size; ddUser.Size = this.DropDownContainer.Parent.Size; }
Loader.
Live Chat Icon For mobile
Up arrow icon