将 Tframe 从 bpl 加载到应用程序

发布于 2024-09-28 10:33:59 字数 64 浏览 0 评论 0原文

我正在尝试在 delphi 包(bpl)中加载 tframe 以在我的主应用程序中显示 请给我包和应用程序的代码。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰魂雪魄 2024-10-05 10:33:59

授人以鱼,可食一日;授人以鱼,可食一生。所以没有适合你的代码:)

你应该如何做:

  1. 启动 Delphi,创建一个新包。
  2. 将 TFrame 添加到您的 bpl
  3. 保存并编译,您现在应该有一个 .bpl 和一个 .dcp。
  4. 关闭所有
  5. 创建新应用程序
  6. 在项目属性中,打开“使用运行时包构建”
  7. 将 bpl 添加到运行时包列表。
  8. 将 bpl 和 dcp 文件的目录包含在搜索路径中
  9. 关闭项目属性
  10. 转到 Form1,将带有 TFrame 的单元添加到您的使用中。
  11. 在 FormCreate 事件中,创建 TFrame 并将其添加到您的应用程序中
  12. 编译并运行

摘要:使用您的框架创建一个包 (bpl)。在您的应用程序中,将 bpl 添加到运行时包列表中,然后像平常一样使用 TFrame。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文