printing multiple richtextboxs into a file

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a function that prints a string from a richtextbox just fine, fully functional with no errors.
But the only problem is I have 12 additional richtextboxs that need to go on a n and in xml format.
Would I begin with a loop? I have looped a variable but control element seems a little different.

public: void printXML()<br/>
<span style="white-space:pre {<br/>
// Create a SaveFileDialog to request a path and file name to save to.<br/>
SaveFileDialog^ saveFile1 = gcnew SaveFileDialog;<br/>
<br/>
// Initialize the SaveFileDialog to specify the RTF extension for the file.<br/>
saveFile1->DefaultExt = "*.rtf";<br/>
saveFile1->Filter = "RTF Files|*.rtf";<br/>
<br/>
// Determine if the user selected a file name from the saveFileDialog.<br/>
if ( saveFile1->ShowDialog() == System::Windows::Forms::DialogResult::OK &&<br/>
saveFile1->FileName->Length > 0 )<br/>
{<br/>
// Save the contents of the RichTextBox into the file.<br/>
richTextBox1->SaveFile( saveFile1->FileName, RichTextBoxStreamType::PlainText );<br/>
}<br/>
<span style="white-space:pre }


View the full article
 
Back
Top