我想创建包括多个标签的面板组件.我的代码如下,面板已创建,但标签没有.错误消息是"地址0040452A处的访问冲突...读取地址FFFFFFD0".
rScan:=rScan+1;
// create panel
with TPanel.Create(self) do begin
Parent:=sxScan;
Name:='pnScanItem'+IntToStr(rScan);
Left:=0;
Top:=4+(rScan-1)*67;
Width:=983;
Height:=68;
Caption:='';
vHandle:=Handle;
end;
// create label
with TLabel.Create(self) do begin
Parent:=TWinControl(vHandle);
Name:='lbScanNam'+IntToStr(rScan);
Left:=11;
Top:=4;
Font.Size:=14;
Caption:='.....';
end;
Run Code Online (Sandbox Code Playgroud) delphi ×1