EDN Admin
Well-known member
public: void printXML()<br/>
<span style="white-spacere {<br/>
<span style="white-spacere array<RichTextBox^> ^ textboxes = gcnew array<RichTextBox^> { richTextBox1, richTextBox2, richTextBox3, richTextBox4, richTextBox5, richTextBox6, richTextBox7, richTextBox8, richTextBox9, richTextBox10, richTextBox11,
richTextBox12};<br/>
<span style="white-spacere SaveFileDialog^ saveFile1 = gcnew SaveFileDialog;<br/>
<span style="white-spacere saveFile1->DefaultExt = "*.rtf";<br/>
<span style="white-spacere saveFile1->Filter = "RTF Files|*.rtf";<br/>
<span style="white-spacere if ( saveFile1->ShowDialog() == System::Windows::Forms:ialogResult::OK && saveFile1->FileName->Length > 0 )<br/>
<span style="white-spacere {<br/>
<span style="white-spacere for each( auto textbox in textboxes )<br/>
<span style="white-spacere {<br/>
<span style="white-spacere //File::AppendAllText(saveFile1->FileName, textbox->Text );<br/>
<span style="white-spacere WriteStartDocument(saveFile1->FileName);<br/>
<span style="white-spacere WriteStartElement("Name");<br/>
<span style="white-spacere WriteString(textbox->Text);<br/>
<span style="white-spacere WriteEndElement();<br/>
<span style="white-spacere File::AppendAllText(saveFile1->FileName, Environment::NewLine);<br/>
<span style="white-spacere }<br/>
<span style="white-spacere }<br/>
<span style="white-spacere }
I am trying to make my object output in xml format. I initiate the object textbox but that holds my string data to be inserted. Do I have to create a second object or is the a cleaner way like File:: is to File::AppendAllText to call on the class declarations?
textboxObject -> convert to XML -> write to file -> write newline -> loop
View the full article
<span style="white-spacere {<br/>
<span style="white-spacere array<RichTextBox^> ^ textboxes = gcnew array<RichTextBox^> { richTextBox1, richTextBox2, richTextBox3, richTextBox4, richTextBox5, richTextBox6, richTextBox7, richTextBox8, richTextBox9, richTextBox10, richTextBox11,
richTextBox12};<br/>
<span style="white-spacere SaveFileDialog^ saveFile1 = gcnew SaveFileDialog;<br/>
<span style="white-spacere saveFile1->DefaultExt = "*.rtf";<br/>
<span style="white-spacere saveFile1->Filter = "RTF Files|*.rtf";<br/>
<span style="white-spacere if ( saveFile1->ShowDialog() == System::Windows::Forms:ialogResult::OK && saveFile1->FileName->Length > 0 )<br/>
<span style="white-spacere {<br/>
<span style="white-spacere for each( auto textbox in textboxes )<br/>
<span style="white-spacere {<br/>
<span style="white-spacere //File::AppendAllText(saveFile1->FileName, textbox->Text );<br/>
<span style="white-spacere WriteStartDocument(saveFile1->FileName);<br/>
<span style="white-spacere WriteStartElement("Name");<br/>
<span style="white-spacere WriteString(textbox->Text);<br/>
<span style="white-spacere WriteEndElement();<br/>
<span style="white-spacere File::AppendAllText(saveFile1->FileName, Environment::NewLine);<br/>
<span style="white-spacere }<br/>
<span style="white-spacere }<br/>
<span style="white-spacere }
I am trying to make my object output in xml format. I initiate the object textbox but that holds my string data to be inserted. Do I have to create a second object or is the a cleaner way like File:: is to File::AppendAllText to call on the class declarations?
textboxObject -> convert to XML -> write to file -> write newline -> loop
View the full article