Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Please Wait...! problem

luckyboyluckyboy Member Posts: 105
hey guys
my problem simply is:
when you make a long job you may inform user to be patient to prevent him from clicking more buttons or doing more jobs
but when i try to show a form having a label saying please wait, the form appears, but the text appears after job has been finished
take look to this code
[code]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form2->Show();
for (int i=0; i<500000000; i++);
}
[/code]
Form2 has a label saying "Please Wait...!"
but my form appears and the text appears after the loop finishes its job
really, very interesting problem lol.

help me solve this please

Comments

  • LundinLundin Member Posts: 3,711
    Did you try Form1->Update or similar?

    It seems to be an update problem where both of the forms are executed from the same thread.
  • luckyboyluckyboy Member Posts: 105
    thanks man, it works fine
    here is the code
    [code]
    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
    Form2->Show();
    Form2->Update();
    for (int i=0; i<1000000000; i++);
    }
    [/code]
    thanks again
Sign In or Register to comment.