Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.11.17;
Скачать: CL | DM;

Вниз

Как сделать цикл по всем элементам формы.   Найти похожие ветки 

 
Zn   (2003-11-05 11:06) [0]

Подскажите, как сделать цикл по всем элементам управления формы (панели, др.). Что-то типа For Each ... In Collection в Visual Basic.


 
serge   (2003-11-05 11:11) [1]

for i:=0 to Form1.ComponentCount-1 do
Components[i].....
ili
for i:=0 to Form1.ControlCount-1 do
Controls[i].....

Udaci


 
Плохиш_   (2003-11-05 11:12) [2]

Ну вот, ещё один вопрос становиться традиционным :-)


 
ZEE ©   (2003-11-05 11:12) [3]

наверно что-то типа:
for i:=0 to ComponentCount-1 do
if (Components[i] is TPanel) then ...


 
Stas ©   (2003-11-05 11:12) [4]

for i=0 to form1.ComponentCount-1
do
form1.components[i] ...


 
Aleksey V.P.   (2003-11-05 11:20) [5]

А как быть с контролами, которые находятся на TTabControl ???


 
serge   (2003-11-05 11:22) [6]

TTabControl.ControlCount ...


 
Anatoly Podgoretsky ©   (2003-11-05 11:24) [7]

Плохиш_ (05.11.03 11:12) [2]
Число школьников растет, у которыз есть компютеры и нет книг.


 
Плохиш_   (2003-11-05 11:33) [8]

Anatoly Podgoretsky © (05.11.03 11:24) [7]
+
а в школе так до сих пор не учат учиться.


 
serge   (2003-11-05 11:34) [9]

Для предотвращения вопросов: ;о)

TComponent.Components
Lists all components owned by the component.
property Components[Index: Integer]: TComponent;
Description

Use Components to access any of the components owned by this component, such as the components owned by a form. The Components property is most useful when referring to owned components by number rather than name. It is also used internally for iterative processing of all owned components.

Note: For convenience use Components with ComponentCount for iterative processing. However, be aware that while the ComponentCount of a component contains the same number of items as in the Components list for that component, ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0.

TComponent.ComponentCount
Indicates the number of components owned by the component.
property ComponentCount: Integer;
Description

Use ComponentCount to find or verify the number of components owned by a component, or when iterating through the Components list to perform some action on all owned components. ComponentCount is used internally for such iterative procedures.

Note: The ComponentCount of a component contains the same number of items as in the Components list for that component, and is always 1 more than the highest Components index, because the first Components index is always 0.

TComponent.ComponentIndex
Indicates the position of the component in its owner"s Components property array.
property ComponentIndex: Integer;
Description

Use ComponentIndex when iterating through the Components list of the component’s owner to perform some action on owned components. It can be used in conjunction with ComponentCount. ComponentIndex is used internally for iterative assignment procedures.

Note: The first component in the list has a ComponentIndex value of 0, the second has a value of 1, and so on. Therefore, when using ComponentIndex with ComponentCount, note that ComponentCount is always 1 more than the highest Components index.

По Control-ам уже смотрите сами в хелпе, если он установлен ;)

Удачи


 
Anatoly Podgoretsky ©   (2003-11-05 11:53) [10]

Плохиш_ (05.11.03 11:33) [8]
Учат, но современники говорят, что качество обучения падает, а цены растут.


 
Zn   (2003-11-05 12:26) [11]

Спасибо всем!
Особенно дюже вумным...



Страницы: 1 вся ветка

Текущий архив: 2003.11.17;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.019 c
3-56497
Makur
2003-10-28 10:27
2003.11.17
Вопрос по TADOStoredProc


1-56632
jazz
2003-11-05 15:52
2003.11.17
Как дать фокус на mrYes


8-56774
Romul
2003-07-18 13:56
2003.11.17
Анимация в JPG-файле


1-56743
Dimaz-z
2003-11-06 16:03
2003.11.17
Что за ошибка - Key violation?


1-56760
slivka
2003-11-06 14:09
2003.11.17
Проблема с циклoм For To do.