There is one detailproblem that always occurs when I read text from a file and then putting this text to a multilined richTextBox.
What happens is that the text begins on Row number 2 in the textbox and not on the top(Row 1).
It seems that a linecharacter perheps is added somewhere but I cant see it.
Because when I the save the text from the textBox and then open the textfile again it starts on Row 3 and so on.
I dont know if I do something wrong in the code.
std::string FileText = "C:\\File1.txt";
ifstream ReadFile(FileText .c_str());
std::string Dummy;
std::vector<string> Fill;
int count = 0;
while( getline(ReadFile, Dummy) )
{
Fill.push_back(Dummy);
count = count + 1;
}
//Now put the elements in vector Fill to textBox
String^ text;
for( int i = 0; i < count; i++ )
{
String^ Dummy2 = gcnew String(Fill[i].c_str());
text += System::Environment::NewLine + Dummy2 ;
this->richTextBox1->WordWrap = false;
this->richTextBox1->Text = text ;
}