J
Jj1985
Unregistered / Unconfirmed
GUEST, unregistred user!
我查詢一數據庫後.
在窗口上動態生成了一些組件:
while not adoquery1.eof do
begin
ss:=Tbsskincheckradiobox.Create(application);
ss.Parent:=box;
ss.Name:='chick'+inttostr(adoquery1.RecNo);
ss.caption:=adoquery1.fieldbyname('name').asstring;
ss.Left:=200;
ss.Top:=30+25*adoquery1.RecNo;
ss.SkinData:=mainskindata;
adoquery1.Next;
end;
現有一按鈕.!單擊它後把上面自動生成的組件中checked為True的Caption顯示出來.!
for i:=0 to form12.ControlCount-1 do
begin
if (form12.Controls is Tbsskincheckradiobox ) then
begin
if (form12.Controls as Tbsskincheckradiobox).Checked then
begin
s:=(form12.Controls as Tbsskincheckradiobox).caption;
showmessage(s);
end;
end;
end; 這段沒反映.!
for i:=1 to adoquery1.RecordCount do
begin
if Tbsskincheckradiobox(findcomponent('chick'+inttostr(i))).Checked then
s:=s+Tbsskincheckradiobox(findcomponent('chick'+inttostr(i))).Caption;
end; 這段報錯.!
請高手幫忙寫出來.
在窗口上動態生成了一些組件:
while not adoquery1.eof do
begin
ss:=Tbsskincheckradiobox.Create(application);
ss.Parent:=box;
ss.Name:='chick'+inttostr(adoquery1.RecNo);
ss.caption:=adoquery1.fieldbyname('name').asstring;
ss.Left:=200;
ss.Top:=30+25*adoquery1.RecNo;
ss.SkinData:=mainskindata;
adoquery1.Next;
end;
現有一按鈕.!單擊它後把上面自動生成的組件中checked為True的Caption顯示出來.!
for i:=0 to form12.ControlCount-1 do
begin
if (form12.Controls is Tbsskincheckradiobox ) then
begin
if (form12.Controls as Tbsskincheckradiobox).Checked then
begin
s:=(form12.Controls as Tbsskincheckradiobox).caption;
showmessage(s);
end;
end;
end; 這段沒反映.!
for i:=1 to adoquery1.RecordCount do
begin
if Tbsskincheckradiobox(findcomponent('chick'+inttostr(i))).Checked then
s:=s+Tbsskincheckradiobox(findcomponent('chick'+inttostr(i))).Caption;
end; 這段報錯.!
請高手幫忙寫出來.