Skip to main content
A newer version of this page is available. .

How to: Display Custom Controls in Popup

The following example creates a PopupContainerEdit class instance and displays a RichTextBox control in the popup window.

First, we create and customize a RichTextBox control. Then, a PopupContainerControl object is created and this will contain the RichTextBox.

To display the PopupContainerControl in the popup window, it should be assigned to the RepositoryItemPopupContainerEdit.PopupControl property.

  RichTextBox rtb = new RichTextBox();
  rtb.Dock = DockStyle.Fill;
  PopupContainerControl popupControl = new PopupContainerControl();
  popupControl.Controls.Add(rtb);

  PopupContainerEdit editor = new PopupContainerEdit();
  editor.Properties.PopupControl = popupControl;
  Controls.Add(editor);