我正在Delphi XE2中编写一个启用触摸屏的应用程序。将Tobject传递给另一个表单?
我有一个表格TEdits
。当我点击它们时,我打电话给我编写的程序,以便在顶部表单上显示另一个最大化,带有标签(用于标题)的TTouchkeyboard
和用于键盘输入的TEdit
。
我的程序(vkeyboard
是我的表单名称与TTouchkeyboard
):
procedure TLogin.showkeyboard(numeric,password: Boolean;
caption,value:string;Sender:TObject);
begin
if numeric then
vkeyboard.TouchKeyboard1.Layout := 'NumPad' // make the TTouchkeyboard on the form numeric or alpha
else
vkeyboard.TouchKeyboard1.Layout := 'Standard';
if password then
vkeyboard.input.PasswordChar := '*' //make the TEdit show * or normal characters
else
vkeyboard.input.PasswordChar := #0;
vkeyboard.title.Caption := caption;
vkeyboard.input.Text := value;
vkeyboard.Show;
end;
我想送Form1.Edit1
对象的形式vkeyboard
,但我不知道如何正确地做到这一点!
为什么?因为我希望能够在输入表单上单击完成(vkeyboard
),然后追溯谁是发件人,然后更新主窗体编辑中的文本!
procedure Tvkeyboard.sButton1Click(Sender: TObject);
begin
(temp as TEdit).Text := input.Text; // send back the text to the right object
vkeyboard.Hide;
end;
这一小部分当然没有工作......我想我需要指定临时对象属于X形式?
为了清楚起见,我想追溯谁叫程序或至少能够在程序中指定它,然后返回文本(从第二个窗体到主窗体)到右侧TEdit
!