Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2003.11.17;
Скачать: [xml.tar.bz2];

Вниз

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

 
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;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.47 MB
Время: 0.01 c
11-56545
gori
2003-02-20 03:25
2003.11.17
DoubleBuffered и второе окно


7-56930
ZeN
2003-09-06 21:21
2003.11.17
Как просканировать папку на предмет наличия файлов...


8-56775
Николай В.
2003-07-22 15:20
2003.11.17
OpenGL


14-56834
Rauf
2003-10-28 02:06
2003.11.17
создание БД MYSQL на сервере h10.ru???


1-56569
kamerad
2003-11-06 12:37
2003.11.17
Компоненты





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский