![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
как можно передать переменную? [D6]
jenbbond © (2002-05-25 08:54:00)Может быть кто подскажет как можно реализовать автоматический перебор
имеющихся BitBtnWithColor(их 20 штук) вместе с циклом. Т.е. как можно показать,
что номер кнопки есть переменная "х" BitBtnWithColor<x>.Color.
Что то вроде $r в перле.
MainDataModule.IBTablePlace.First;
for x:=1 to MainDataModule.IBTablePlace.RecordCount do begin
n:=MainDataModule.IBTablePlace.FieldByName("zanyto").AsInteger;
if n=0 then
BitBtnWithColorx.Color:=clBlue;
^^
if n=1 then
BitBtnWithColorx.Color:=clRed;
^^
MainDataModule.IBTablePlace.Next;
x:=x+1;
end;
jenbbond (2002-05-25 09:31:00) [1]Классно. Спасибо!!!
MBo (2002-05-25 09:25:00) [2]for i:=0 to ComponentCount-1 do
if Components[i] is TBitBtnWithColor then
TBitBtnWithColor(Components[i]). ///делаешь, что нужно
jenbbond (2002-05-25 09:20:00) [3]Я что-то не доконца понял.
Т.е. мне надо прописать BitBtnWithColorCount???
MBo (2002-05-25 08:58:00) [4]ComponentCount, Components[i], is
или
ControlCount, Controls[i], is