没有表单的非视觉组件

发布于 2024-09-29 21:09:20 字数 150 浏览 0 评论 0原文

我开始仅使用 delphi 2009 中的 dpr 文件创建应用程序,我认为所有基本的东西都可以工作,我使用系统,sysutils 等等......但现在我想使用计时器和其他一些非可视组件(一些基本的 indy 组件使用互联网)有什么方法可以做到这一点 我不介意使用单位(但不使用表格)

i started creating application only using dpr file in delphi 2009 , i think all basic things work i use system ,sysutils and more.... but now i want to use timer and some other non-visual components (some basic indy components to use internet) is there any ways to do this
i do not bother using units (but not forms)

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

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

发布评论

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

评论(2

零度° 2024-10-06 21:09:24

您可以通过调用其构造函数并将 nil 作为所有者传递来创建任何组件。如果您自己管理,则不需要家长表格。但对于某些事情,您仍然需要一个使用表单的项目,即使您没有将组件放置在其中。例如,对于 TTimer,您必须运行 VCL Forms 应用程序,因为它依赖于 Application 及其消息循环来使计时器工作。

You can create any component by calling its constructor and passing nil as the owner. You won't need a parent form if you manage it yourself. But for some things, you will still need a project that uses forms, even if you're not placing your component on one. For TTimer, for example, you have to be running a VCL Forms app because it depends on Application and its message loop to make the timer work.

jJeQQOZ5 2024-10-06 21:09:22

您可以将非可视组件放在数据模块上。

我经常使用它,因为您仍然拥有设计时的优势(对象检查器中的属性和事件,设计器中的逻辑布局)。

——杰罗恩

You can put non-visual components on a Data Module.

I use that a lot because you still have the design-time benefits (properties and events in the object inspector, logical placement in your designer).

--jeroen

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