Jump to content

Как перебрать все элементы на форма/фрейме?


dbf_usr

Recommended Posts

for i := 0 to ComponentCount-1 do 
 if Components[i] is TEdit then 
  (Components[i] as TEdit).Color := clRed;

Вот такой код работает в VCL приложениях. В UniGUI не нащел ни у форм ни у фреймов свойств Componets. За ранее не известно сколько элементов на форме, нужно обойти все. Как это сделать?

Link to comment
Share on other sites

19 hours ago, dbf_usr said:

for i := 0 to ComponentCount-1 do 
 if Components[i] is TEdit then 
  (Components[i] as TEdit).Color := clRed;

Вот такой код работает в VCL приложениях. В UniGUI не нащел ни у форм ни у фреймов свойств Componets. За ранее не известно сколько элементов на форме, нужно обойти все. Как это сделать?

uses uniGUIForm, uniGUIFrame


for z := 0 to AForm.ComponentCount - 1 do
        AForm.Components[z]

for z := 0 to AFrame.ComponentCount - 1 do
        AFrame.Components[z]

 

Пробовал у себя работает

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...