Hi,
I've looked at the previous answers on this one such as http://www.telerik.com/forums/open-a-windows-form-in-tabbed-document however this doesn't do the trick for me. The goal is to design controls for a new document window and load that with details when the user double clicks on a list item to edit and view it in detail. When I try adding it as such:
detailsForm _detailsForm = new detailsForm(listitem);
_detailsForm.Dock = DockStyle.Fill;
_detailsForm.TopMost = false;
_detailsForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
_detailsForm.Show();
this.documentWindow1.Controls.Add(_detailsForm);
I get the below exception:
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=Top-level control cannot be added to a control.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
.....
Any ideas why?
I've looked at the previous answers on this one such as http://www.telerik.com/forums/open-a-windows-form-in-tabbed-document however this doesn't do the trick for me. The goal is to design controls for a new document window and load that with details when the user double clicks on a list item to edit and view it in detail. When I try adding it as such:
detailsForm _detailsForm = new detailsForm(listitem);
_detailsForm.Dock = DockStyle.Fill;
_detailsForm.TopMost = false;
_detailsForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
_detailsForm.Show();
this.documentWindow1.Controls.Add(_detailsForm);
I get the below exception:
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=Top-level control cannot be added to a control.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
.....
Any ideas why?