I will read a .txt-file "DGD.txt" 49 times. To keep track of that I use a foor-loop for the count. Inside the foor-loop I have a while-loop that read this file.
For every count I will put a text to a Label1 like this:
Code:
Label1->Text = "Display this";
So this meens that before reading the file in the whilestatement this should be displayed in the Label1 Box and also be rewritten the other 48 counts(This Text will change later but this is a test)
However what happens is that the text "Display this" i put to the Label1 first when count is at 49.
Why is this happening. I want it to update for every loop, in this case 49 times.
Any idéas to this. I dont know If I need to use (WM_PAINT) in any way here ?
Code:
std::string Line;
ofstream MainFile;
MainFile.open ("Main.txt");
for (int count= 1; count < (50); count++)
{
Label1->Text = "Display this";
Label1->Invalidate();
ifstream File ("File1.txt");
while ( getline(File, Line, '\n') )
{
MainFile << "Hello" << ',' << "Hello2" << '\n';
}
}
If I would put this messagebox inside the for-loop this will "Display this" 49 times as a comparison.
Code:
MessageBox::Show("Display this");