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