In the project I’m working I need forms I can embed into my main window. One of the solutions you’ll find is:

// Panel myPanel = new Panel();
form.TopLevel = false;
form.Parent = myPanel;
// etc.

The problem is that you’ll find textboxes not working correctly. You can’t e.g. set the position of the caret, it only appears at the end or the beginning of the box or it selects the whole text.

There is a better solution which I strongly recommend:

myMainForm.IsMdiContainer = true;
form.MdiParent = myMainForm;
// etc.

With this solution you get back perfectly working textboxes.😀