home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / various / formpos / formpos.txt < prev   
Encoding:
Text File  |  1994-09-04  |  907 b   |  25 lines

  1. Here are two routines that I regularly use for loading and saving form positions into an .INI file.
  2.  
  3. The LoadFormPosition takes one parameter (f as Form), and uses the .Tag property of that form to find a section entry in the application's .INI file. If a section entry is found, LoadFormPosition reads the 'Top' and 'Left' entries, and moves the form to the position indicated by those entries.
  4. The SaveFormPosition takes one parameter (f as Form), and uses the .Tag property of that form to create/write a new section in the application's .INI file. The section will look something like this:
  5.  
  6. [XYZZY]
  7. Top=0
  8. Left=0
  9. Height=2295
  10. Width=2295
  11.  
  12. To use these routines, do this:
  13.  
  14. In FormXYZZY_Load, call:
  15.  
  16.     LoadFormPosition Me
  17.  
  18. In FormXYZZY_Unload, call:
  19.  
  20.     SaveFormPosition Me    
  21.  
  22. -- Ebbe Jonsson, Systems Mangler
  23. ebbe@dbm.fi, ebbe@shsibm.shh.fi
  24. DBM Database Marketing Oy, Helsinki, Finland
  25.