小
小娘皮
Unregistered / Unconfirmed
GUEST, unregistred user!
下面这个进程用于拷贝组件,(《delphi5从入门到精通》75页),
请你给每一句加注释:
procedure TForm1.ClickComp(Sender: TObject);
var
ControlText: string;
begin
with TControlClass (Sender.ClassType).Create (Self) do
begin
Parent := (Sender as TControl).Parent;
Left := (Sender as TControl).Left + 10;
Top := (Sender as TControl).Top + 10;
SetLength (ControlText, 50);
(Sender as TControl).GetTextBuf(
PChar(ControlText), 50);
ControlText := PChar(ControlText) + ' *';
SetTextBuf (PChar (ControlText));
end;
end;
请你给每一句加注释:
procedure TForm1.ClickComp(Sender: TObject);
var
ControlText: string;
begin
with TControlClass (Sender.ClassType).Create (Self) do
begin
Parent := (Sender as TControl).Parent;
Left := (Sender as TControl).Left + 10;
Top := (Sender as TControl).Top + 10;
SetLength (ControlText, 50);
(Sender as TControl).GetTextBuf(
PChar(ControlText), 50);
ControlText := PChar(ControlText) + ' *';
SetTextBuf (PChar (ControlText));
end;
end;