比如我在面板上放了40个Label,名字依次为:Lbl1,Lbl2,Lbl3...,现在我要在程序运行时给每一个Label设置Caption分别为XX1,XX2,XX3...
用什么样的方法最简单。
(别给我说一个一个的设置啊^-^)
用什么样的方法最简单。
(别给我说一个一个的设置啊^-^)
解决方案 »
- fastreport4 一放个从表就 out of memory
- apro 多个传真页的问题
- 巨奇怪的问题! adoCmd.CommandText:='UPdate student set stdno=:stdno';
- Midas+COM+基本问题
- 很急啊,在线等待,大家进来看看
- dbgrid1.options.dgMultiSelect:=true;这句话为什么有错误?
- CoreSoapCtrl源代码
- 请教实现大小写转换的函数?
- 如何截获MEMO的滚动条事件.----急救!
- 请问一个有关Socket的SendStream函数的问题
- DBChart做统计图的问题
- 几们简单的问题,想请大家帮帮忙,谢谢!
Dim o
For Each o In Me.Controls
If (Left(o.Name, 2) = "LB") Then
o.Caption = "eee"
End If
Next
End Sub
begin for I:=0 to 100 do
begin
(FindComponent('label' + inttoStr(i)) as TLabel).Caption := 'Caption' + IntToStr(i);
end;end;
begin
if Self.Components[n] is TLabel then
(Self.Components[n] as TLabel).Caption:='eee';
end;
Private Sub Command1_Click()
Dim o
For Each o In Me.Controls
If (Left(o.Name, 2) = "LB") Then
o.Caption = "eee"
End If
Next
End Sub
*******************************
原来这个五星是搞VB的,哈哈哈哈。
var I: integer;
begin for I:=0 to 100 do
begin
(FindComponent('label' + inttoStr(i)) as TLabel).Caption := 'Caption' + IntToStr(i);
end;end;
那就用
(FindComponent('Lbl' + inttoStr(i)) as TLabel).Caption := 'Caption' + IntToStr(i);