mdomeyko
Programmer
- Sep 26, 2006
- 7
I have a form with 190 buttons and have to use only a group about 34. I have a DB with the text to be used.
Is there any way to put db text into each selected button caption dynamicly with out doing it one-by-one?
I'm a delphi rockie, so please help!
I've tried doing the following but get invalid access error...
var ctxt : string; i : integer;
while NOT q_main_buts.EOF do begin
for i := 74 to 100 do begin
ctxt := 'XiButton' + trim(inttostr(i)); // dynamic assign
TXiButton(ctxt).caption := q_main_butsCategory.asstring;
end;
q_main_buts.next;
end;
Is there any way to put db text into each selected button caption dynamicly with out doing it one-by-one?
I'm a delphi rockie, so please help!
I've tried doing the following but get invalid access error...
var ctxt : string; i : integer;
while NOT q_main_buts.EOF do begin
for i := 74 to 100 do begin
ctxt := 'XiButton' + trim(inttostr(i)); // dynamic assign
TXiButton(ctxt).caption := q_main_butsCategory.asstring;
end;
q_main_buts.next;
end;