1
votes

I am trying to load a tframe inside a delphi package (bpl) to be shown in my main app please give me code for both package and application.

1

1 Answers

10
votes

Give a man a fish and he eats for a day, learn a man to fish and he eats his whole life. So no code for you :)

How you should do it:

  1. Start Delphi, Create a new package.
  2. Add a TFrame to your bpl
  3. Save and compile, you should now have a .bpl and a .dcp.
  4. Close all
  5. Create a new application
  6. In your project properties, turn on "Build with Runtime packages"
  7. Add your bpl to the runtime packages list.
  8. Include the directories of your bpl and dcp files in the search path
  9. Close your project properties
  10. Go to your Form1, add the unit with your TFrame to your uses.
  11. In the FormCreate event, create the TFrame and add it to your application
  12. Compile and run

Summary: Create a package (bpl) with your frames. In your application, add the bpl to your runtime packages list and then use the TFrames as you would normally do.