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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load component display in memory before displaying on screen?

Status
Not open for further replies.

doctorjellybean

Programmer
May 5, 2003
145
I'm using a ShellTree component, and at application startup it displays the default folder selected by the user.

When the application starts, there is a slight hesitation before the ShellTree display appears. The actual window appears and then the tree when the info has been read.

Now I'm wondering if it is possible to load the display, info, into memory and once ShellTree has loaded the required tree in memory, then display it on screen?

There have been a few times when I wondered whether this type of behaviour is possible for other components.
 
If I understand you correctly, you want the tree to finish loading before the entire form is displayed?

I've never used TShellTree and I don't have the documentation for it, but there should be an OnChange event of some kind. You can watch this for update, then show the form afterward.

I don't know if that will work or not... but I think the standard behavior is a little nicer, because the user doesn't wonder if the program is running while large trees are loading...

Hope this helps.
 
never used a ShellTree either, but are you using a Begin/End update around your code to populate it?
It works wonders with other string containers.

Steve (Delphi 2007 & XP)
 
If I understand you correctly, you want the tree to finish loading before the entire form is displayed?

Correct. I'll investigate the OnChange event, but the Tree is populated in the formcreate event. It basically reads the starting folder from a settings file, which has been specified by the user in an options menu. So not sure about the Begin/End update code either.
 
For the begin/end update process you typically will call:

Control.BeginUpdate;
try
code to populate the control
finally
Control.EndUpdate;
end;

So even within your FormCreate function you can still make this call. It prevents the program from spending resources on sorting, drawing, etc. that are processor intensive.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top