Message without any buttons

Hi,

On MYForm1 I need to to some processing which takes some time.
Therefor I want to inform the enduser about the progress of what's happening.
Therefor the text in the message must be updated during the process.
I don't want to use a regular MessageDlg, because the user has to push the OK-button for each message (I don't want to interupt the processing).
After processing the message will be removed from the screen (programmatically from within MyFrom1).

How can I add a message without any buttons?

Please give me some code samples or small project.

Regards,
Stef
Stef MerlijnDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcsentinelCommented:
If you want it on a seperate form then simply create a new form, set borderstyle to bsdialog, set FormStyle to fsStayOnTop. Put a label on the form and add someting like

public
  procedure ShowInfo(Info: string);
end;


var
  TInfoForm: TInfoForm;

procedure TInfoForm.ShowInfo(Info: string);
begin
  label1.caption:=Info;
  label1.repaint;
end;


on the mainform, the one that is doing the processing.

at the start of the processing do
Application.CreateForm(TInfoForm, InfoForm);
InforForm.Show;  ----- not showmodal
process some stuff
InfoForm.ShowInfo('Done stage one');
process some stuff
InfoForm.ShowInfo('Done stage two);
process some stuff etc etc
FreeAndNil(InfoForm);


or you could add a statusbar to the bottom of your mainform and right the progress to that

hope this helps

regards

kretzschmarCommented:
?? just create a small form, which you can show like

var pForm : TProgressform; //holds only a label, and id setup to be a ontop-window
....
  pForm := TProgressform.Create(self);
  pForm.Show;
  pForm.Label1.Caption := 'Starting . . .';
  ....processing
  ..update progess
  pForm.Label1.Caption := 'Now Doing something . . .';
  ...further processing
  ...end provessing
  pForm.release;
....

meikl ;-)
sas13Commented:
1. Use Application.ProcessMessages

procedure Form1.Button1Click(Sender: TObject);
var
  _i: integer;
begin
  for _i := 0 to 10000 do begin
   Label1.Caption := IntToStr(_i);
   Application.ProcessMessages; // this instruction allow update display message
  end
end;

2. Use TThread

type
  TThread1 = class(TThread)
  private
    FInc: integer;
    procedure UpdateLabel;
  protected
    procedure Execute; override;
  end;

procedure TThread1.UpdateLabel;
begin
  Form1.Label1.Caption := IntToStr(FInc);
end;

procedure TThread1.Execute;
begin
  FreeOnTerminate := true;
  for FInc := 0 to 10000 do begin
   ///
   Synhronize(UpdateLabel)
  end
end;

procedure Form1.Button1Click(Sender: TObject);
begin
 TMyThread.Create(false)
end;

ps. Pseudocode

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.