Load Tframe from bpl to application

旧巷老猫 提交于 2019-12-08 05:26:18

问题


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:


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.



来源:https://stackoverflow.com/questions/3994629/load-tframe-from-bpl-to-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!