怎样获取一个Label的Top属性的值?? 搞不明白你的问题你说的上一个lable指的是什么 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 固定最下面的Label,其他的动态设置Label1.Top := Label.Top + 100;Label2.Top := Label1.Top + 100;ePing 问题是,我的Label的Name也是动态生成的,所以,如果我知道上一个Label的名字,也就简单了! i:=0;with TLabel.Create(self) dobegin inc(i); parent:=panel1; name:='Label'+inttostr(i); top:=TLabel(FindComponent('Label'+inttostr(i-1)).top+10; caption:='My name is Label'+inttostr(i-1); visible:=true;end;你在動態生成Label時賦個名字供以后用不就得了嗎? 对,这个我知道,但是现实中,我不得不非次序的命名Label,也就是说,也许Label1在Panel1中,而Label2在Pannel2中,又或者Panel1中有Label1和Label4,Panel2中有Label2和Label3,所以很难取得Label的名字!我是想有没有方法,通过Panel取Panel中所有的Label的集合,然后就可以方便得到上一个Label的Top属性了 这么好玩的东西,干嘛取一个不好的标题参考:TWinControl.ControlCount,TWinControl.Controls 要通过Panel取Panel中所有的Label的集合,可以先知道其控件的数量Panel1.ControlCount,再做其他操作 for i:=0 to Panel.ControlCount-1 do if Controls[i].ClassType=TLabel then ....... milpas,不好意思,我结贴的时候,你的贴子还没有发出来,真的不好意思!谢谢各位的参与! 怎么获得控件的屏幕坐标? 请教 这是为什么?(关于消息) 如何用网页作软件的导航栏 想要求出一天中的两段时间差,如果大于4小时,做程序a,否则做程序b 如何取得空闲的驱动器号(或称盘符) 请求winsocket api解答? 高手看一下,access violation错误{form1.DBGrideh1.ColumnCount - 1} 谁用过.XML文件?要点资料行不,帮帮我。谢谢。 用delphi写程序,有时出现语法错误实在是难发现,难修改,有没有好的办法优化解决呢? 关于大数据量读取的问题!! 各位高手,关于 BDE error $000f?????????
Label2.Top := Label1.Top + 100;ePing
with TLabel.Create(self) do
begin
inc(i);
parent:=panel1;
name:='Label'+inttostr(i);
top:=TLabel(FindComponent('Label'+inttostr(i-1)).top+10;
caption:='My name is Label'+inttostr(i-1);
visible:=true;
end;
你在動態生成Label時賦個名字供以后用不就得了嗎?
参考:
TWinControl.ControlCount,TWinControl.Controls
Panel1.ControlCount,再做其他操作
if Controls[i].ClassType=TLabel then
.......