Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Popup Control for WinPopupContainer
posted

Hello,

I assigned for WinPopupContainer property PopupControl:

this.ultraPopupControlContainer1.PopupControl = this.contextMenuStrip1;

When I invoke this control

ultraPopupControlContainer1.Show();

System generate exception(Messege: "Top-level control cannot be added to a control.").  What is wrong?

 

Thanks,

Ruslan 

  • 37774
    Verified Answer
    posted

     Ruslan,

     This happens because when you try to show the UltraPopupControlContainer, it attemps to reparent the ContextMenuStrip, which you cannot do for a TopLevel control.  Try setting "this.contextMenuStrip1.TopLevel = false;", which should solve this problem.

    -Matt