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.
Syncfusion Feedback

GradientPanel BackgroundColor

Thread ID:

Created:

Updated:

Platform:

Replies:

16112 Jul 6,2004 02:12 PM UTC Jul 7,2004 02:49 PM UTC Windows Forms 2
loading
Tags: Tools
Lori S. Pearsall
Asked On July 6, 2004 02:12 PM UTC

I''m attempting to use the BackgroundColor.WriteXML to write out the current setting of a panel but I''m getting nothing - stream length of zero. Here''s a code sample : MemoryStream strOutput = new MemoryStream(); System.Xml.XmlTextWriter writer = new XmlTextWriter(strOutput, null); this.BackgroundColor = new BrushInfo(Color.Purple); this.brush.WriteXml(writer); What am I missing??

Lori S. Pearsall
Replied On July 6, 2004 02:14 PM UTC

Let''s try this again - code sample : MemoryStream strOutput = new MemoryStream(); System.Xml.XmlTextWriter writer = new XmlTextWriter(strOutput, null); this.BackgroundColor = new BrushInfo(Color.Purple); this.BackgroundColor.WriteXml(writer); What am I missing??

Administrator [Syncfusion]
Replied On July 7, 2004 02:49 PM UTC

Hi Lori You could use the XmlSerializer Class to do what you are seeking. Here is a code snippet which saves the information in a file called bginfo.xml: string xmlFilename = "bginfo.xml"; XmlSerializer serializer = new XmlSerializer(typeof(Syncfusion.Drawing.BrushInfo)); Stream fs = new FileStream(xmlFilename, FileMode.Create); System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(fs, System.Text.Encoding.Default); serializer.Serialize(fs,this.gradientPanel1.BackgroundColor); writer.Close(); Regards, Arun

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.

Warning Icon 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.Close Icon

;