We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Saving and Loading TabbedMDI State to a string

Thread ID:

Created:

Updated:

Platform:

Replies:

56424 Feb 14,2007 03:17 PM Feb 16,2007 02:27 AM Windows Forms 3
loading
Tags: Tools
Surya
Asked On February 14, 2007 03:17 PM

I am using the following code to save and load tabbedMDIState to a string. Saving is working but Load does not work. I am not sure if I am
missing something here. Help in this regard would be appreciated.

Save :
-----------------------------------------------
MemoryStream xmlStream = new MemoryStream();
AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFmtStream, xmlStream);

this.tabbedMdiManager.SaveTabGroupStates(aser);
aser.PersistNow();

xmlStream.Position = 0;
System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(xmlStream);
string s=null;
while (reader.Read())
{
s = reader.ReadString();
if(s.Contains(" }
tabState.Remove(0, tabState.Length);
tabState.Append(s);
while (reader.Read())
{
tabState.Append(reader.ReadString());
}
xmlStream.Close();
reader.Close();
-------------------------------------------------
Load.
-------------------------------------------------
MemoryStream xmlStream = new MemoryStream();
UTF8Encoding x = new UTF8Encoding();
byte[] y = x.GetBytes(tabState.ToString());
xmlStream.Write(y, 0, y.Length);
xmlStream.Position = 0;
Console.WriteLine(tabState.ToString());

AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFmtStream,xmlStream);
this.tabbedMdiManager.LoadTabGroupStates(aser);

xmlStream.Close();

Poly J [Syncfusion]
Replied On February 15, 2007 02:28 PM

Hi Surya,

Are you loading the tab state info for the child forms creating in run time? If you are doing so, you should create the forms before loading the tab state.
Please refer the sample attached in the previous thread (http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=56114).
If I have misunderstood your requirement please let me know.

Regards,
Poly


Surya
Replied On February 15, 2007 02:58 PM

Poly :

Thanks for your very good example.

But here ..
I am just trying to save the state to a string
and reload it on click of a button.I am not exiting the application

Thanks
Surya

Poly J [Syncfusion]
Replied On February 16, 2007 02:27 AM

Hi Surya,

Thanks for the update.

You can use the same approach shown in the last sample for reload the tab state in button click event. You can save the child forms name in Array list when saving the state and when button click for loading the previously saved state, recreate the child forms which are not present in the Mdi children collection and load the tab states.

Please let me know if you need further assistance with this incident.

Thanks for your interest in Syncfusion products.

Regards,
Poly

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;