How can I get Form1 redraw? lazarus / 8-Other ---------------------------------------------------------------------- dek · 2008-06-06 22:23 Hi, I am very new in Lazarus programing on Windows platform. I have Pascal programing experience on Turbo Pascal on DOS and Virtual Pascal on OS/2. But, today I have started to try Lazarus and got a problem on the code below. Form1 has Button1 and ProgressBar1. Clicking Button1, it starts the following procedure and a message box appears. After I click Ok on the massage box, it is still on screen and starts ProgressBar1 moving. I think that form1 does not have refresh at the moment. When this procedure (for loop) finishs, it has refresh. I have tried to erase the message box after clicking OK button using "form1.update" and/or "form1.refresh" as shown in the code below. But it did not work. Could you tell me what is wrong my code? Haw I can get Form1 redraw? procedure TForm1.Button1Click(Sender: TObject); var   i  : integer; begin   ShowMessage('Hello World!');   form1.Update;   For i:=1 to 10 do   begin     ProgressBar1.Position:=i*10;     delay(100);   end;   Button2.Enabled:=true;   Button2.SetFocus; end; ---------------------------------------------------------------------- theo · 2008-06-07 10:24 Try Application.Processmessages instead of form1.update. ---------------------------------------------------------------------- dek · 2008-06-07 12:27 Hi theo, Yeah, it works. Thanks. Where or How can I get this kind of information? ---------------------------------------------------------------------- theo · 2008-06-07 12:57 Hmm, difficult if you don't know what to look for ;-) I'd recommend a good delphi book or the forum. ---------------------------------------------------------------------- dek · 2008-06-07 13:43 Ok. I will have a Delphi book. Thanks.