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

Question about popup container.....

Is there a way to get the popup for a combo box, to function like a dialog form (modal form). What I want to do is have the user not be able to click out of the popup until they click a button in this popup that signals and end (and as such, validates what the user entered). I was close to accomplish this, but had some things not trappable. This included the switching programs (when you come back the popup is gone), click on the parent form and other events that I wasn''t sure how to keep from happening. Any help would be appreciated. I currently got the combo box working with a borderless form, and that seems to do what I want, but I have a few issues that don''t exist with the use of a popup, that I rather not have to deal with. Thanks, Javier

3 Replies

AD Administrator Syncfusion Team August 26, 2004 06:19 PM UTC

Hi Javier, Presently, the ComboDropDown''s PopupControlContainer cannot be displayed as a purely modal dialog. A workaround here would be to handle the BeforePopup event of the PopupContainer and then display a custom form modally in its position. Form2 popupForm; private void PopupContainer_BeforePopup(object sender, CancelEventArgs args) { args.Cancel = true; popupForm = new Form2(); popupForm.BackColor = Color.LightSkyBlue; popupForm.FormBorderStyle = FormBorderStyle.None; popupForm.Width = this.comboDropDown1.Width; popupForm.Height = this.comboDropDown1.Width; popupForm.StartPosition = FormStartPosition.Manual; popupForm.Location = this.PointToScreen(new Point(48, 77)); popupForm.ShowDialog(); } Please refer to the sample that illustrates this and letm eknow if this meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team August 26, 2004 06:53 PM UTC

I''m doing the same thing in slightly diffrent way, the problem I am having is my combobox button stays in "pushed mode". I''m using OfficeXP style. If you change the style on your example, it seems to have the same problem. How do you fix this???


AD Administrator Syncfusion Team August 27, 2004 01:49 PM UTC

Hi Javier, Thanks for the update. I do see this problem here. A workaround here would be to handle the PopupControlContainer''s Popup and CloseUp events instead of the BeforePopup event. this.comboDropDown1.PopupContainer.Popup += new EventHandler(this.PopupContainer_Popup); this.comboDropDown1.PopupContainer.CloseUp += new PopupClosedEventHandler(this.PopupContainer_CloseUp); private void PopupContainer_Popup(object sender, EventArgs e) { this.comboDropDown1.PopupContainer.HidePopup(); } private void PopupContainer_CloseUp(object sender, PopupClosedEventArgs args) { popupForm = new Form2(); popupForm.BackColor = Color.LightSkyBlue; popupForm.FormBorderStyle = FormBorderStyle.None; popupForm.Width = this.comboDropDown1.Width; popupForm.Height = this.comboDropDown1.Width; popupForm.StartPosition = FormStartPosition.Manual; popupForm.Location = this.PointToScreen(new Point(48, 77)); popupForm.ShowDialog(); } Please refer to the modified sample attached here that shows this workaround, and let me know if this works for you. Thanks for your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Up arrow icon