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

Two quick questions

Status
Not open for further replies.

KempCGDR

Programmer
Jan 10, 2003
445
GB
Hi, I'll get straight into the questions:

1) When I know a form isn't going to be used again in my app, I use [Form Name].Destroy, does this actually free up the memory or is there some extra stuff you have to do, or is that just totally wrong?

2) When you have put a picture into a TImage via [TImage Name].Picture.LoadFromFile(Filename), how do you remove the picture and make it blank again?

Thanks
 
1) We use:
form1 := nil;
form1.release;
although we have an object managing the forms.

Delphi help says:
Do not call Destroy. Instead, call Release, which posts a CM_RELEASE message to the form. The handler for CM_RELEASE calls the Free method, which in turn calls Destroy.

2) Can you set the Image1.Picture.Graphic := nil? Or can you load an empty bitmap? I don't think it has any kind of clear property. Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top