Our application has a MainForm that has TabbedMdiManager and creates MDI child forms.
Now, we are trying to turn this MainForm as a user control.
It seems to me that there are two options:
1. Turn MainForm as a user control; But, would menu and tabbed MDI still work?
2. embed MainForm into a user control; Is this possible to do?
Thanks.
Mike
mike2008 said:1. Turn MainForm as a user control; But, would menu and tabbed MDI still work?
The toolbars manager will work inside a UserControl, but the tabbed mdi manager will not.
mike2008 said:2. embed MainForm into a user control; Is this possible to do?
You can embed a Form inside a UserControl as long as you set TopLevel to False and Visible to True on the Form. Then add it to the Controls collection of the UserControl.
A further question to the second approach:
If I embed the MainForm into a UserControl, would the tabbed mdi manager work?
Thanks.Mike
I don't think there is any sample which saves and loads the tab order, but you could do it with the SaveTabOrderAsBinary, SaveTabOrderAsXml, LoadTabOrderFromBinary, and LoadTabOrderFromXml methods.
Mike Dour"] you could do it with the SaveTabOrderAsBinary, SaveTabOrderAsXml, LoadTabOrderFromBinary, and LoadTabOrderFromXml methods.
Tried those method, but save is fine, but load does not create the tabs.
I may need to create my own serialization/deserialization methods.
BTW, I found the way to set the close button and reorder tabs by dragging.
The load methods are not supposed to create the tabs, they just reorder the tabs to a previously saved tab order.
I presume i can iterate throught the VisiableTabs collection instead of Tabs collection.
Yes, that is correct, the VisibleTabs collection will be in the same order as seen on screen.
To save the contents of each tab, can I use SerializeTag and DeserializeTag?