I’m looking at updating some existing code and making a popup modal which contains a custom user control and wondering if this is possible?
I know if I was to place the custom UserControl inside another form this could be achieved quite easily but this seems a bit overkill.
(CommentBox is the custom control)
CommentBox comment = CommentManager.GetComments(commentType, foreignID);
.//Some code to determine location of the popup
.
.
Popup popup = new Popup(comment);
popup.Show(grid.PointToScreen(viewerLocation));
If it has to be modal, then you have to use a form.
If you are just needing it to pop up over the form, then look into
ToolStripDropDownandToolStripControlHostto provide that ability. Here is an example: Padding/ Size / Margin, when using ToolstripControlHost for a popup control