EDN Admin
Well-known member
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
re {<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:
ialogResult::OK &&<br/>
saveFile1->FileName->Length > 0 )<br/>
{<br/>
// Save the contents of the RichTextBox into the file.<br/>
richTextBox1->SaveFile( saveFile1->FileName, RichTextBoxStreamType:
lainText );<br/>
}<br/>
<span style="white-space
re }
View the full article
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

// 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:

saveFile1->FileName->Length > 0 )<br/>
{<br/>
// Save the contents of the RichTextBox into the file.<br/>
richTextBox1->SaveFile( saveFile1->FileName, RichTextBoxStreamType:

}<br/>
<span style="white-space

View the full article