Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forms not appearing the right way

Status
Not open for further replies.

TheForestMan

IS-IT--Management
Apr 22, 2005
2
BE
Hello!

I have a little problem with an application where I am using a separate form to display a progress bar. The problem is that when I call the progress bar form, it does not show up completely.

Here some code example I use :

to show the form:

procedure ShowProgressBar(visible : boolean);
begin
if visible then ProgressBarForm.show
else ProgressBarForm.hide;
end;

where I call the ShowProgressBar procedure:

procedure DoSomeStuff;
begin
ShowProgressBar(true);
// some code here

ShowProgressBar(false);
end;

It seems the progressbar form does not show up completely until the calling procedure is completely run.
I tried using showmodal instead but it make sense it then waits for the user to do something and the calling procedure does not execute until so.

Note: forms are all auto-created when running the application.

Does anyone knows what is wrong with this code?

Thanks in advance for your help,

Cheers

TheForestMan



 

You didn't indicate where you are actually updating the progress bar from your "some code here" routine.

The other thing you may need to do is insert
[tt]
Application.ProcessMessages;
[/tt]
inside your "some code here" routine to give Windows an opportunity to update the progress bar window.

 
Thanks for your quick answer. The application.ProcessMessages does the trick indeed. I guess the process was pending in the queue (I am still a newbie).

Sorry for being unclear in my question, actually the progressbar was not really the problem here, it was just that the form did not show up properly. Hence me not showing the progress bar code which seemed to be irrelevant in my question.

Thanks again,

Cheers,

TheForestMan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top