print richtextbox to file, no error

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am trying to use the save richtextbox to file feature. Line 401 I define printXML() and line 510 I am calling on it. I am using the code straight from the msdn library and visual studio debug indicates no error.
http://msdn.microsoft.com/en-us/library/aa984410(v=vs.71).aspx http://msdn.microsoft.com/en-us/library/aa984410(v=vs.71).aspx


#pragma once<br/>
#include <string><br/>
#include <vector><br/>
<br/>
using namespace std;<br/>
using namespace System;<br/>
using std::vector;<br/>
<br/>
std::vector<string> laVector(10);<br/>
<br/>
namespace winForm1{<br/>
<br/>
<br/>
<span style="white-space:pre using namespace System;<br/>
<span style="white-space:pre using namespace System::ComponentModel;<br/>
<span style="white-space:pre using namespace System::Collections;<br/>
<span style="white-space:pre using namespace System::Windows::Forms;<br/>
<span style="white-space:pre using namespace System::Data;<br/>
<span style="white-space:pre using namespace System::Drawing;<br/>
<span style="white-space:pre /// <summary><br/>
<span style="white-space:pre /// Summary for Form1<br/>
<span style="white-space:pre /// </summary><br/>
<br/>
<span style="white-space:pre public ref class Form1 : public System::Windows::Forms::Form<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre public:<br/>
<span style="white-space:pre Form1()<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre InitializeComponent();<br/>
<span style="white-space:pre //constructor code<br/>
<span style="white-space:pre }<br/>
<br/>
<span style="white-space:pre protected:<br/>
<span style="white-space:pre /// <summary><br/>
<span style="white-space:pre /// Clean up any resources being used.<br/>
<span style="white-space:pre /// </summary><br/>
<span style="white-space:pre ~Form1()<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre if (components)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre delete components;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox1;<br/>
<span style="white-space:pre protected: <br/>
<span style="white-space:pre private: System::Windows::Forms::Button^ button1;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox2;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox3;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox4;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox5;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox6;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox7;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox8;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox9;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox10;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox11;<br/>
<span style="white-space:pre private: System::Windows::Forms::RichTextBox^ richTextBox12;<br/>
<span style="white-space:pre private: System::Windows::Forms::Button^ button2;<br/>
<span style="white-space:pre private: System::Windows::Forms::Button^ button3;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label1;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label2;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label3;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label4;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label5;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label6;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label7;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label8;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label9;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label10;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label11;<br/>
<span style="white-space:pre private: System::Windows::Forms::Label^ label12;<br/>
<br/>
<span style="white-space:pre private:<br/>
<span style="white-space:pre /// <summary><br/>
<span style="white-space:pre /// Required designer variable.<br/>
<span style="white-space:pre /// </summary><br/>
<span style="white-space:pre System::ComponentModel::Container ^components;<br/>
<br/>
#pragma region Windows Form Designer generated code<br/>
<span style="white-space:pre /// <summary><br/>
<span style="white-space:pre /// Required method for Designer support - do not modify<br/>
<span style="white-space:pre /// the contents of this method with the code editor.<br/>
<span style="white-space:pre /// </summary><br/>
<span style="white-space:pre void InitializeComponent(void)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox3 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox4 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox5 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox6 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox7 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox8 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox9 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox10 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox11 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->richTextBox12 = (gcnew System::Windows::Forms::RichTextBox());<br/>
<span style="white-space:pre this->button1 = (gcnew System::Windows::Forms::Button());<br/>
<span style="white-space:pre this->button2 = (gcnew System::Windows::Forms::Button());<br/>
<span style="white-space:pre this->button3 = (gcnew System::Windows::Forms::Button());<br/>
<span style="white-space:pre this->label1 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label2 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label3 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label4 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label5 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label6 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label7 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label8 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label9 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label10 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label11 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->label12 = (gcnew System::Windows::Forms::Label());<br/>
<span style="white-space:pre this->SuspendLayout();<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox1<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox1->Location = System::Drawing::Point(40, 42);<br/>
<span style="white-space:pre this->richTextBox1->Name = L"richTextBox1";<br/>
<span style="white-space:pre this->richTextBox1->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox1->TabIndex = 0;<br/>
<span style="white-space:pre this->richTextBox1->Text = L"";<br/>
<span style="white-space:pre this->richTextBox1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);<br/>
<span style="white-space:pre this->richTextBox1->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox1_TextChanged);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox2<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox2->Location = System::Drawing::Point(146, 42);<br/>
<span style="white-space:pre this->richTextBox2->Name = L"richTextBox2";<br/>
<span style="white-space:pre this->richTextBox2->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox2->TabIndex = 2;<br/>
<span style="white-space:pre this->richTextBox2->Text = L"";<br/>
<span style="white-space:pre this->richTextBox2->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox2_TextChanged);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox3<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox3->Location = System::Drawing::Point(252, 42);<br/>
<span style="white-space:pre this->richTextBox3->Name = L"richTextBox3";<br/>
<span style="white-space:pre this->richTextBox3->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox3->TabIndex = 3;<br/>
<span style="white-space:pre this->richTextBox3->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox4<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox4->Location = System::Drawing::Point(358, 42);<br/>
<span style="white-space:pre this->richTextBox4->Name = L"richTextBox4";<br/>
<span style="white-space:pre this->richTextBox4->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox4->TabIndex = 4;<br/>
<span style="white-space:pre this->richTextBox4->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox5<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox5->Location = System::Drawing::Point(40, 119);<br/>
<span style="white-space:pre this->richTextBox5->Name = L"richTextBox5";<br/>
<span style="white-space:pre this->richTextBox5->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox5->TabIndex = 5;<br/>
<span style="white-space:pre this->richTextBox5->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox6<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox6->Location = System::Drawing::Point(146, 119);<br/>
<span style="white-space:pre this->richTextBox6->Name = L"richTextBox6";<br/>
<span style="white-space:pre this->richTextBox6->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox6->TabIndex = 6;<br/>
<span style="white-space:pre this->richTextBox6->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox7<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox7->Location = System::Drawing::Point(252, 119);<br/>
<span style="white-space:pre this->richTextBox7->Name = L"richTextBox7";<br/>
<span style="white-space:pre this->richTextBox7->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox7->TabIndex = 7;<br/>
<span style="white-space:pre this->richTextBox7->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox8<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox8->Location = System::Drawing::Point(358, 119);<br/>
<span style="white-space:pre this->richTextBox8->Name = L"richTextBox8";<br/>
<span style="white-space:pre this->richTextBox8->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox8->TabIndex = 8;<br/>
<span style="white-space:pre this->richTextBox8->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox9<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox9->Location = System::Drawing::Point(40, 191);<br/>
<span style="white-space:pre this->richTextBox9->Name = L"richTextBox9";<br/>
<span style="white-space:pre this->richTextBox9->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox9->TabIndex = 9;<br/>
<span style="white-space:pre this->richTextBox9->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox10<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox10->Location = System::Drawing::Point(146, 191);<br/>
<span style="white-space:pre this->richTextBox10->Name = L"richTextBox10";<br/>
<span style="white-space:pre this->richTextBox10->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox10->TabIndex = 10;<br/>
<span style="white-space:pre this->richTextBox10->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox11<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox11->Location = System::Drawing::Point(252, 191);<br/>
<span style="white-space:pre this->richTextBox11->Name = L"richTextBox11";<br/>
<span style="white-space:pre this->richTextBox11->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox11->TabIndex = 11;<br/>
<span style="white-space:pre this->richTextBox11->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // richTextBox12<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->richTextBox12->Location = System::Drawing::Point(358, 191);<br/>
<span style="white-space:pre this->richTextBox12->Name = L"richTextBox12";<br/>
<span style="white-space:pre this->richTextBox12->Size = System::Drawing::Size(100, 20);<br/>
<span style="white-space:pre this->richTextBox12->TabIndex = 12;<br/>
<span style="white-space:pre this->richTextBox12->Text = L"";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // button1<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->button1->Location = System::Drawing::Point(40, 320);<br/>
<span style="white-space:pre this->button1->Name = L"button1";<br/>
<span style="white-space:pre this->button1->Size = System::Drawing::Size(75, 23);<br/>
<span style="white-space:pre this->button1->TabIndex = 1;<br/>
<span style="white-space:pre this->button1->Text = L"&FFmpeg";<br/>
<span style="white-space:pre this->button1->UseVisualStyleBackColor = true;<br/>
<span style="white-space:pre this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // button2<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->button2->Location = System::Drawing::Point(146, 320);<br/>
<span style="white-space:pre this->button2->Name = L"button2";<br/>
<span style="white-space:pre this->button2->Size = System::Drawing::Size(75, 23);<br/>
<span style="white-space:pre this->button2->TabIndex = 13;<br/>
<span style="white-space:pre this->button2->Text = L"&IDv3";<br/>
<span style="white-space:pre this->button2->UseVisualStyleBackColor = true;<br/>
<span style="white-space:pre this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // button3<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->button3->Location = System::Drawing::Point(382, 320);<br/>
<span style="white-space:pre this->button3->Name = L"button3";<br/>
<span style="white-space:pre this->button3->Size = System::Drawing::Size(75, 23);<br/>
<span style="white-space:pre this->button3->TabIndex = 14;<br/>
<span style="white-space:pre this->button3->Text = L"&WriteXML";<br/>
<span style="white-space:pre this->button3->UseVisualStyleBackColor = true;<br/>
<span style="white-space:pre this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label1<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label1->AutoSize = true;<br/>
<span style="white-space:pre this->label1->Location = System::Drawing::Point(40, 26);<br/>
<span style="white-space:pre this->label1->Name = L"label1";<br/>
<span style="white-space:pre this->label1->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label1->TabIndex = 15;<br/>
<span style="white-space:pre this->label1->Text = L"Title";<br/>
<span style="white-space:pre this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label2<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label2->AutoSize = true;<br/>
<span style="white-space:pre this->label2->Location = System::Drawing::Point(143, 26);<br/>
<span style="white-space:pre this->label2->Name = L"label2";<br/>
<span style="white-space:pre this->label2->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label2->TabIndex = 16;<br/>
<span style="white-space:pre this->label2->Text = L"Describtion";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label3<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label3->AutoSize = true;<br/>
<span style="white-space:pre this->label3->Location = System::Drawing::Point(249, 26);<br/>
<span style="white-space:pre this->label3->Name = L"label3";<br/>
<span style="white-space:pre this->label3->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label3->TabIndex = 17;<br/>
<span style="white-space:pre this->label3->Text = L"Rating";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label4<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label4->AutoSize = true;<br/>
<span style="white-space:pre this->label4->Location = System::Drawing::Point(355, 26);<br/>
<span style="white-space:pre this->label4->Name = L"label4";<br/>
<span style="white-space:pre this->label4->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label4->TabIndex = 18;<br/>
<span style="white-space:pre this->label4->Text = L"Artist";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label5<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label5->AutoSize = true;<br/>
<span style="white-space:pre this->label5->Location = System::Drawing::Point(37, 103);<br/>
<span style="white-space:pre this->label5->Name = L"label5";<br/>
<span style="white-space:pre this->label5->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label5->TabIndex = 19;<br/>
<span style="white-space:pre this->label5->Text = L"Album";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label6<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label6->AutoSize = true;<br/>
<span style="white-space:pre this->label6->Location = System::Drawing::Point(143, 103);<br/>
<span style="white-space:pre this->label6->Name = L"label6";<br/>
<span style="white-space:pre this->label6->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label6->TabIndex = 20;<br/>
<span style="white-space:pre this->label6->Text = L"Year";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label7<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label7->AutoSize = true;<br/>
<span style="white-space:pre this->label7->Location = System::Drawing::Point(249, 103);<br/>
<span style="white-space:pre this->label7->Name = L"label7";<br/>
<span style="white-space:pre this->label7->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label7->TabIndex = 21;<br/>
<span style="white-space:pre this->label7->Text = L"Track";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label8<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label8->AutoSize = true;<br/>
<span style="white-space:pre this->label8->Location = System::Drawing::Point(355, 103);<br/>
<span style="white-space:pre this->label8->Name = L"label8";<br/>
<span style="white-space:pre this->label8->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label8->TabIndex = 22;<br/>
<span style="white-space:pre this->label8->Text = L"Genre";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label9<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label9->AutoSize = true;<br/>
<span style="white-space:pre this->label9->Location = System::Drawing::Point(40, 175);<br/>
<span style="white-space:pre this->label9->Name = L"label9";<br/>
<span style="white-space:pre this->label9->Size = System::Drawing::Size(35, 13);<br/>
<span style="white-space:pre this->label9->TabIndex = 23;<br/>
<span style="white-space:pre this->label9->Text = L"Comment";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label10<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label10->AutoSize = true;<br/>
<span style="white-space:pre this->label10->Location = System::Drawing::Point(143, 175);<br/>
<span style="white-space:pre this->label10->Name = L"label10";<br/>
<span style="white-space:pre this->label10->Size = System::Drawing::Size(41, 13);<br/>
<span style="white-space:pre this->label10->TabIndex = 24;<br/>
<span style="white-space:pre this->label10->Text = L"Bitrate";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label11<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label11->AutoSize = true;<br/>
<span style="white-space:pre this->label11->Location = System::Drawing::Point(249, 175);<br/>
<span style="white-space:pre this->label11->Name = L"label11";<br/>
<span style="white-space:pre this->label11->Size = System::Drawing::Size(41, 13);<br/>
<span style="white-space:pre this->label11->TabIndex = 25;<br/>
<span style="white-space:pre this->label11->Text = L"Duration";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // label12<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->label12->AutoSize = true;<br/>
<span style="white-space:pre this->label12->Location = System::Drawing::Point(355, 175);<br/>
<span style="white-space:pre this->label12->Name = L"label12";<br/>
<span style="white-space:pre this->label12->Size = System::Drawing::Size(41, 13);<br/>
<span style="white-space:pre this->label12->TabIndex = 26;<br/>
<span style="white-space:pre this->label12->Text = L"Unused";<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre // Form1<br/>
<span style="white-space:pre // <br/>
<span style="white-space:pre this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);<br/>
<span style="white-space:pre this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;<br/>
<span style="white-space:pre this->ClientSize = System::Drawing::Size(551, 368);<br/>
<span style="white-space:pre this->Controls->Add(this->label12);<br/>
<span style="white-space:pre this->Controls->Add(this->label11);<br/>
<span style="white-space:pre this->Controls->Add(this->label10);<br/>
<span style="white-space:pre this->Controls->Add(this->label9);<br/>
<span style="white-space:pre this->Controls->Add(this->label8);<br/>
<span style="white-space:pre this->Controls->Add(this->label7);<br/>
<span style="white-space:pre this->Controls->Add(this->label6);<br/>
<span style="white-space:pre this->Controls->Add(this->label5);<br/>
<span style="white-space:pre this->Controls->Add(this->label4);<br/>
<span style="white-space:pre this->Controls->Add(this->label3);<br/>
<span style="white-space:pre this->Controls->Add(this->label2);<br/>
<span style="white-space:pre this->Controls->Add(this->label1);<br/>
<span style="white-space:pre this->Controls->Add(this->button3);<br/>
<span style="white-space:pre this->Controls->Add(this->button2);<br/>
<span style="white-space:pre this->Controls->Add(this->button1);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox12);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox11);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox10);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox9);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox8);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox7);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox6);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox5);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox4);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox3);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox2);<br/>
<span style="white-space:pre this->Controls->Add(this->richTextBox1);<br/>
<span style="white-space:pre this->Name = L"Form1";<br/>
<span style="white-space:pre this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);<br/>
<span style="white-space:pre this->ResumeLayout(false);<br/>
<span style="white-space:pre this->PerformLayout();<br/>
<br/>
<span style="white-space:pre }<br/>
#pragma endregion<br/>
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre LoadMyFile ();<br/>
<span style="white-space:pre }<br/>
private: System::Void richTextBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre <br/>
<span style="white-space:pre }<br/>
private: System::Void richTextBox2_TextChanged(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre }<br/>
<br/>
public: void printXML()<br/>
<span style="white-space:pre {<br/>
// You should replace the bold file name in the <br/>
// sample below with a file name of your own choosing.<br/>
richTextBox1->SaveFile(String::Concat<br/>
(System::Environment::GetFolderPath<br/>
(System::Environment::SpecialFolder::Personal),<br/>
"\Testdoc.rtf"), RichTextBoxStreamType::RichNoOleObjs);<br/>
<span style="white-space:pre }<br/>
public:<span style="white-space:pre void LoadMyFile()<br/>
{<br/>
<br/>
// Load the contents of the file into the RichTextBox.<br/>
<span style="white-space:pre for (int i = 0, n = 1; i < 9, n < 10; i++, n++)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre switch (i)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre case 0:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox1->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 1:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox2->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 2:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox3->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 3:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox4->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 4:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox5->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 5:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox6->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 6:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox7->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 7:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox8->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 8:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox10->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre case 9:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre string element;<br/>
<span style="white-space:pre element = laVector.at(i);<br/>
<span style="white-space:pre String^ newElement = gcnew String(element.c_str());<br/>
<span style="white-space:pre richTextBox11->Text = newElement;<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre break;<br/>
<span style="white-space:pre default:<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre }<br/>
<span style="white-space:pre private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre }<br/>
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre }<br/>
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre printXML();<br/>
<span style="white-space:pre }<br/>
private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {<br/>
<span style="white-space:pre }<br/>
<br/>
<br/>
<br/>
};<br/>
}<br/>


View the full article
 
Back
Top