It's a pleasure to share some information with you.
Excuse me, does anybody know how to have two FORMS running at the same time?
I mean, I execute a FOR clicking one BUTTON on FORM1 and set FOR's values to a LABEL on FORM2.
Here some codes in FORM1:
void __fastcall Form1::Button1Click(TObject *Sender){
int i = 0;
for (i=0;i<=10000;i++){
Form1->Label1->Caption = i;
Form2->Label1->Caption = i;
}
}
I just want to see this:
if.... Form1->Label1->Caption
= 1, Form2->Label1->Caption
has to be 1 too and so on.
FORM2 shows me just the last result, which is 10,000.
I appreciate any help. Thank you !
Just call
Update()
: (*)Update():
Application->ProcessMessages() will also work, but it's not the right choice: it interrupts the execution of an application so that it can process the message queue.
ProcessMessages
can be way slower.(*) Changed since Remy's hint was absolutely better than the original answer (
Update
vsProcessMessages
)