unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,mmsystem,
StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure Btn2Click(Sender: TObject); public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}
var
edt2:Tedit;
btn2:TButton;procedure TForm1.Btn2Click(Sender: TObject);
begin
edit1.SetFocus;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if edt2<>nil then
edt2.SetFocus
else
begin
edt2 :=Tedit.Create(self);
Edt2.Height := edit1.Height;
edt2.Width := edit1.Width;
edt2.Left := edit1.Left;
edt2.Top := edit1.Top+ edit1.Height+10;
edt2.Parent := form1;
edt2.Visible :=true; btn2 :=Tbutton.Create(self);
btn2.Height := button1.Height;
btn2.Width := button1.Width;
btn2.Left := button1.Left;
btn2.Top := button1.Top+ button1.Height+10;
btn2.OnClick := Btn2Click;
btn2.Parent := form1;
btn2.Visible :=true; edt2.SetFocus;
end;
end;end.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,mmsystem,
StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure Btn2Click(Sender: TObject); public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}
var
edt2:Tedit;
btn2:TButton;procedure TForm1.Btn2Click(Sender: TObject);
begin
edit1.SetFocus;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if edt2<>nil then
edt2.SetFocus
else
begin
edt2 :=Tedit.Create(self);
Edt2.Height := edit1.Height;
edt2.Width := edit1.Width;
edt2.Left := edit1.Left;
edt2.Top := edit1.Top+ edit1.Height+10;
edt2.Parent := form1;
edt2.Visible :=true; btn2 :=Tbutton.Create(self);
btn2.Height := button1.Height;
btn2.Width := button1.Width;
btn2.Left := button1.Left;
btn2.Top := button1.Top+ button1.Height+10;
btn2.OnClick := Btn2Click;
btn2.Parent := form1;
btn2.Visible :=true; edt2.SetFocus;
end;
end;end.
解决方案 »
- 画图程序,如何表现选中图形和选中的图形被拖动的过程
- 关于过程调用
- 关于treeview问题,为什么int时可以运行,但为什么char时就不可以运行了呢?
- 用ttimer組件如何確定在每天的固定時刻觸發ttimer1timer事件! 求救!
- 新手提问,谢谢。马上结账!!!!!!!!
- 求教!!!Delphi三层开发中用存储过程用游标返回数据集的问题
- 为什么Delphi返回的字符串长度不对?
- 急!如何添加组件啊!!!
- 高级问题:delphi封面那位女神叫什么名字?
- 三层架构中的数据访问
- 哪里有做异形窗体的源程序或控件
- 同志们,interbase中如何将double precision字段转成numeric或decimal字段啊?
begin
edit1.text:=edt2.text;
edit1.SetFocus;
end;