如何在delphi中将值传递给一个表单到第二个表单? [英] How can I pass the value to the one form to second one in delphi?

查看:85
本文介绍了如何在delphi中将值传递给一个表单到第二个表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面是包含的复选框,我需要在其他页面上获取复选框的值。

如何将值传递到一到二页?



我尝试了什么:



没什么特别的

google searchs

i have one page which is inluded checkbox and i need to get the checkbox's values on other page.
how can i pass the value to one to second page?

What I have tried:

nothing special
google searchs

推荐答案

你可以访问它。



在Unit2中提及你的Unit1(其他形式)(第1页) )在使用

如果你已经在unit1使用中添加了unit2,你必须在unit2的实现使用部分中添加unit1。



然后您可以调用这些物品。



样本(来自实施部分):



You can just access it.

Mention your Unit1(Other form) in Unit2(1st page) in uses
In case you have already added unit2 in unit1 uses, You will have to add unit1 in implementation uses section of unit2.

You can then just call the items.

Sample(from implementation section):

implementation

{


R * .dfm}

使用
Unit1;

程序TForm2.Button1Click(发件人:TObject);
开始
如果 Form1.CheckBox1.Checked 然后
Label1.Caption:= ' 已检查'
else
Label1.Caption:= ' 未选中'
结束;

end
R *.dfm} uses Unit1; procedure TForm2.Button1Click(Sender: TObject); begin if Form1.CheckBox1.Checked then Label1.Caption := 'Checked' else Label1.Caption := 'Unchecked' end; end.


这篇关于如何在delphi中将值传递给一个表单到第二个表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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