Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.Printing Private xmlMemoryStream As System.IO.MemoryStream = Nothing Private Sub btnXmlSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnXmlSave.Click If Not Me.xmlMemoryStream Is Nothing Then Me.xmlMemoryStream.Close() End If Me.xmlMemoryStream = New System.IO.MemoryStream() Me.UltraPrintDocument1.SaveAsXml(Me.xmlMemoryStream) End Sub Private Sub btnXmlLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXmlLoad.Click If Me.xmlMemoryStream Is Nothing Then Return End If Me.xmlMemoryStream.Position = 0 Me.UltraPrintDocument1.LoadFromXml(Me.xmlMemoryStream) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.Printing; private System.IO.MemoryStream xmlMemoryStream = null; private void btnXmlSave_Click(object sender, System.EventArgs e) { if (this.xmlMemoryStream != null) this.xmlMemoryStream.Close(); this.xmlMemoryStream = new System.IO.MemoryStream(); this.ultraPrintDocument1.SaveAsXml(this.xmlMemoryStream); } private void btnXmlLoad_Click(object sender, System.EventArgs e) { if (this.xmlMemoryStream == null) return; this.xmlMemoryStream.Position = 0; this.ultraPrintDocument1.LoadFromXml(this.xmlMemoryStream); }