Delphi访问表单 [英] Delphi accesing forms

查看:77
本文介绍了Delphi访问表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i给Delphi带来了问题。



我的项目有一个表格被命名为ufrmBilgi,

一个名为UScale的函数。



i希望以uscale的形式访问uFrmBilgi的复选框检查值



我怎样才能进入?



我尝试过:



searcing google

lookinhg documnet

但这些不起作用

Hi everyone,

i have a problem to Delphi.

my project have one form which is named ufrmBilgi,
one functions which is named UScale.

i want to access uFrmBilgi's checkbox check value in uscale

how can i access?

What I have tried:

searcing google
lookinhg documnet
but these isnt work

推荐答案

我必须猜到复选框的名称,但你可能想要的是



CheckBox1.Checked



您可以在 uFrmBilgi 的声明中查看CheckBox的内容,以防它出现异类。



略有如果你的函数 UScale 不是 uFrmBilgi 的一部分会更复杂,因为那时Delphi不知道你在谈论哪种形式(可能有不止一件事)叫 CheckBox1 。在这种情况下你可以说



uFrmBilgi.CheckBox1.Checked



下一个复杂因素是Delphi不能找到 uFrmBilgi 。如果您 UScale uFrmBilgi 不在同一个文件中,则可能会这样。在这种情况下,您必须将文件的名称添加到包含 UScale 的文件中的uses子句中。只需在语句使用后将文件名添加到文件列表中。



希望有效!



Jon
I've got to guess at the name of the check box but what you probably want is

CheckBox1.Checked

You can see what the CheckBox is called in the declaration of uFrmBilgi in case it is something different.

It is slightly more complicated if your function UScale is not part of uFrmBilgi because then Delphi won't know which form you are talking about (there might be more than one thing called CheckBox1. In which case you can say

uFrmBilgi.CheckBox1.Checked

The next complication is if Delphi cannot find uFrmBilgi. This will probably be if you UScale is not in the same file as uFrmBilgi. In this case you have to add the name of the file to the uses clause in the file containing UScale. Just add the name of the file to the list of files after the statement Uses.

Hope that works!

Jon


为了回答许多类似的问题,我写了关于.NET的表单协作的文章;我还介绍了WPF。我没有费心去覆盖Delphi(也可以用Lazarus库LCL覆盖Free Pascal),但由于Delphi是.NET的前身,因此您可以轻松应用相同的原则。



所以,试着阅读文章并理解它;如果您了解Delphi,即使您不了解C#,也可以轻松捕捉到相当简单的解决方案:许多问题一次回答 - Windows窗体或WPF Windows之间的协作



如果有什么不清楚,你的欢迎提出后续问题。



-SA
To answer many similar questions, I wrote and article on form collaboration for .NET; I also covered WPF. I did not bother to cover Delphi (which could also cover Free Pascal with Lazarus library LCL), but as Delphi is predecessor of .NET, you can easily apply the same principles.

So, try to read the article and understand it; if you know Delp you can easily catch the idea of the fairly trivial solution, even if you don't know C#: Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows.

If something is unclear, your follow-up questions will be welcome.

—SA


这篇关于Delphi访问表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆